GetPlayerVehicleSeat

From SA-MP Wiki

Jump to: navigation, search

GetPlayerVehicleSeat


Warning: This function was added in SA-MP version 0.3. It is not available in previous versions.


Find out what seat a player is in.


Parameters:
(playerid)
playeridThe ID of the player you want to get the seat of.


ReturnsSeat ID (0-driver, 1-co-driver, 2&3-passengers, if the car has enough seats).


Important Note: Will also return 0 if the player is not in a vehicle!


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/myseat", true) == 0)
    {
        new string[14];
        format(string, sizeof(string), "Your seat: %i", GetPlayerVehicleSeat(playerid));
        SendClientMessage(playerid, 0xFFFFFFFF, string);
        return 1;
    }
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

Personal tools