Skip to content

SetPlayerCartSeat

Moves a seated player to another seat of their cart.

On the bench (0-1) or in the back (2-5) they move over at once; between the bench and the back their game climbs down and up again, so the cart must stand for that (on the two-wheeler: between the reins and a side rail). Seat 0 of a free cart hands them the reins; leaving it lets go of them (the cart stands). A locked seat (SetCartSeatLocked) is the mode’s to give. OnPlayerChangeCartSeat follows. false when they sit in no cart, the seat is taken or there is none, the reins of a route cart are asked for, they are still climbing in (or moving already), or the cart moves on a move between the bench and the back.

SetPlayerCartSeat(pid, seat)
Parameter Type
pid number the player
seat number the seat (0 = at the reins)

boolean

-- /drive: a passenger takes the free reins of their cart
local cart, seat = GetPlayerCart(pid)
if cart and not GetCartSeatPlayer(cart, 0) and not SetPlayerCartSeat(pid, 0) then
SendClientMessage(pid, COLOR_RED, "Not now - the cart has to stand, and a route's wagoner keeps his reins.")
end

OnPlayerChangeCartSeat · GetCartSeatPlayer · PutPlayerInCart · the Carts group of the index