GetPlayerContactElement

From Multi Theft Auto: Wiki
Revision as of 21:10, 7 August 2007 by MrJax (talk | contribs) (New page: __NOTOC__ {{Client function}} <!-- Describe in plain english what this function does. Don't go into details, just give an overview --> This function detects the vehicle a player is standi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function detects the vehicle a player is standing on.

Syntax

element getPlayerContactElement ( player thePlayer )

Required Arguments

  • thePlayer: The player you want to get the vehicle he is touching from.

Returns

Returns a vehicle if the player is touching one, false if he is touching none or is a invalid player.

Example

This example shows the name of the vehicle the player is standing on. It will output 'false' if he is not.

local vehicle = getPlayerContactVehicle ( getLocalPlayer() )
local name = getVehicleName(vehicle)
outputChatBox(tostring(name))

See Also