GetPedOccupiedVehicleSeat

From Multi Theft Auto: Wiki
Revision as of 23:15, 18 January 2009 by Ccw (talk | contribs) (New page: __NOTOC__ {{Server function}} This function gets the seat that a specific ped is sitting in in a vehicle. ==Syntax== <syntaxhighlight lang="lua">int getPedOccupiedVehicleSeat ( ped thePed )</syntaxhighlight> ===R...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Syntax

int getPedOccupiedVehicleSeat ( ped thePed )

Required Arguments

  • thePed: The ped whose vehicle seat you're looking up.

Returns

Returns an integer containing the number of the seat that the ped is currently in, if any. Returns false if the ped is on foot, or the ped doesn't exist.

Example

This example finds what seat the player called 'someguy' is sitting in and outputs it to the chat box.

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

See Also