GetPlayerVehicleID

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:24, 8 January 2014
Vince (Talk | contribs)

← Previous diff
Revision as of 17:10, 2 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|This function gets the ID of the vehicle the player is currently in. Note: '''NOT''' the model id of the vehicle. See [[GetVehicleModel]] for that.}} {{Description|This function gets the ID of the vehicle the player is currently in. Note: '''NOT''' the model id of the vehicle. See [[GetVehicleModel]] for that.}}
Line 26: Line 25:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +
 +[[fr:GetPlayerVehicleID]]

Revision as of 17:10, 2 February 2014



Description:

This function gets the ID of the vehicle the player is currently in. Note: NOT the model id of the vehicle. See GetVehicleModel for that.


Parameters:
(playerid)
playeridThe ID of the player in the vehicle that you want to get the ID of


Return Values:

ID of the vehicle or 0 if not in a vehicle


//add 10x Nitro if the player is in a car. Might be called on a command.
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(vehicle > 0)
{
    AddVehicleComponent(vehicle, 1010);
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

In other languages