GetPlayerVehicleID

From SA-MP Wiki

Jump to: navigation, search

GetPlayerVehicleID


This function gets the ID of the vehicle the player is currently in


Parameters:
(playerid)
playeridThe player in the vehicle that you want to get the ID of
ReturnsID 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 might be useful as well, as they're related to this function in one way or another.

Personal tools