GetPlayerOccupiedVehicle: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
No edit summary |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">vehicle getPlayerOccupiedVehicle ( player player )</syntaxhighlight> | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 10: | Line 10: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua">if ( vehicle = getPlayerOccupiedVehicle ( findPlayer ( "Someguy" ) ) ) | |||
OutputChatBox ( "Someguy is in a vehicle with ", getVehicleHealth ( vehicle ), " health." ) | |||
else | |||
Outputchatbox ( "Someguy is not in a vehicle." ) | |||
end</syntaxhighlight> |
Revision as of 03:32, 20 May 2006
Description
This function returns a vehicle that the player is currently in, if any. This function returns false if the player is on foot, or the player doesn't exist.
Syntax
vehicle getPlayerOccupiedVehicle ( player player )
Required Arguments
- player: The player whose vehicle you're looking up.
Example
if ( vehicle = getPlayerOccupiedVehicle ( findPlayer ( "Someguy" ) ) ) OutputChatBox ( "Someguy is in a vehicle with ", getVehicleHealth ( vehicle ), " health." ) else Outputchatbox ( "Someguy is not in a vehicle." ) end