getPedOccupiedVehicleSeat | Multi Theft Auto: Wiki Skip to content

getPedOccupiedVehicleSeat

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function gets the seat that a specific ped is sitting in in a vehicle.

OOP Syntax Help! I don't understand this!

  • Note: Prior to 1.5, the variable was .occupiedVehicleSeat

  • Method:ped:getOccupiedVehicleSeat(...)
  • Variable: .vehicleSeat

Syntax

int getPedOccupiedVehicleSeat ( ped thePed )
Required Arguments
  • thePed: The ped whose vehicle seat you're looking up.

Returns

  • int: value

Returns false if the ped is on foot, or the ped doesn't exist.

Code Examples

shared

This example finds what seat a random player is sitting in and outputs it to the chat box.

thePed = getRandomPlayer()
theVehicle = getPedOccupiedVehicle ( thePed )
if ( theVehicle ) then
outputChatBox ( getPlayerName(thePed).." is in a vehicle in seat number " .. getPedOccupiedVehicleSeat ( thePed ) .. "." )
else
outputChatBox ( getPlayerName(thePed).." is not in a vehicle." )
end

See Also