GetPlayerOccupiedVehicleSeat: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function gets the seat that a specific player is sitting in in a vehicle.
This function returns an integer containing the number of the seat 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==
==Syntax==
<syntaxhighlight lang="lua">int getPlayerOccupiedVehicleSeat ( player player )</syntaxhighlight>
<syntaxhighlight lang="lua">int getPlayerOccupiedVehicleSeat ( player thePlayer )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''player''': The [[player]] whose vehicle seat you're looking up.
*'''thePlayer''': The [[player]] whose vehicle seat you're looking up.
 
===Returns===
Returns an integer containing the number of the seat that the player is currently in, if any. Returns false if the player is on foot, or the player doesn't exist.


==Example==
==Example==
<syntaxhighlight lang="lua">if ( vehicle = getPlayerOccupiedVehicle ( findPlayer ( "Someguy" ) ) )
This example finds what seat the player called ''someguy'' is sitting in and outputs it to the chat box.
   outputChatBox ( "Someguy is in a vehicle seat ", getPlayerOccupiedVehicleSeat ( findPlayer ( "Someguy" ) ), "." )
<syntaxhighlight lang="lua">if ( vehicle = getPlayerOccupiedVehicle ( findPlayer ( "someguy" ) ) )
   outputChatBox ( "someguy is in a vehicle in seat number " .. getPlayerOccupiedVehicleSeat ( findPlayer ( "Someguy" ) ) .. "." )
else
else
   outputChatBox ( "Someguy is not in a vehicle." )
   outputChatBox ( "someguy is not in a vehicle." )
end</syntaxhighlight>
end</syntaxhighlight>


==See Also==
==See Also==
{{Player functions}}
{{Player functions}}

Revision as of 11:16, 14 August 2006

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

Syntax

int getPlayerOccupiedVehicleSeat ( player thePlayer )

Required Arguments

  • thePlayer: The player whose vehicle seat you're looking up.

Returns

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

Example

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

if ( vehicle = getPlayerOccupiedVehicle ( findPlayer ( "someguy" ) ) )
  outputChatBox ( "someguy is in a vehicle in seat number " .. getPlayerOccupiedVehicleSeat ( findPlayer ( "Someguy" ) ) .. "." )
else
  outputChatBox ( "someguy is not in a vehicle." )
end

See Also

Shared