GetPlayerOccupiedVehicle
From Multi Theft Auto: Wiki
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use getPedOccupiedVehicle instead. |
This function gets the vehicle that the player is currently in, if any.
Syntax
vehicle getPlayerOccupiedVehicle ( player thePlayer )
Required Arguments
- thePlayer: The player whose vehicle you're looking up.
Returns
Returns the vehicle that the specified player is in, or false if the player is not in a vehicle or is an invalid player.
Example
When a player enters the 'vehiclename' command and is currently in a vehicle, this example outputs the name of the vehicle.
Click to collapse [-]
Server and clientfunction showVehicleName ( thePlayer ) local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) if ( theVehicle ) then local vehicleName = getVehicleName ( theVehicle ) outputChatBox ( "Vehicle name: " .. vehicleName, thePlayer ) end end addCommandHandler ( "vehiclename", showVehicleName )
See Also
- forcePlayerMap
- getAlivePlayers
- getDeadPlayers
- getPlayerACInfo
- getPlayerAnnounceValue
- getPlayerBlurLevel
- getPlayerCount
- getPlayerFromName
- getPlayerIdleTime
- getPlayerIP
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
FROM VERSION 1.5.7 r19626 ONWARDS
- getPlayerSerial
- getPlayerTeam
- getPlayerVersion
- getPlayerWantedLevel
- getRandomPlayer
- givePlayerMoney
- isPlayerMapForced
- isPlayerMuted
- isPlayerNametagShowing
- isVoiceEnabled
- redirectPlayer
- resendPlayerACInfo
- resendPlayerModInfo
- setPlayerAnnounceValue
- setPlayerBlurLevel
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerMuted
- setPlayerName
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
FROM VERSION 1.5.7 r19626 ONWARDS
- setPlayerTeam
- setPlayerVoiceBroadcastTo
- setPlayerVoiceIgnoreFrom
- setPlayerWantedLevel
- spawnPlayer
- takePlayerMoney
- takePlayerScreenShot