GetPlayerVehicleSeat

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:25, 2 March 2011
JernejL (Talk | contribs)

← Previous diff
Revision as of 13:46, 3 March 2011
LaZ (Talk | contribs)

Next diff →
Line 10: Line 10:
{{Returns|Seat ID (-1 if the player is not in a vehicle, 0 driver, 1 co-driver, 2&3 passengers, if the car has enough seats).}} {{Returns|Seat ID (-1 if the player is not in a vehicle, 0 driver, 1 co-driver, 2&3 passengers, if the car has enough seats).}}
-{{note|Sometimes result can be 128 which is a invalid seat id. Circumstances of this are not yet known, but it is best to discard information when returned seat number is 128}}+{{note|Sometimes result can be 128 which is an invalid seat id. Circumstances of this are not yet known, but it is best to discard information when returned seat number is 128}}
<pawn> <pawn>

Revision as of 13:46, 3 March 2011


GetPlayerVehicleSeat was added in SA-MP 0.3a This function was added in SA-MP 0.3a and will not work in earlier 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 (-1 if the player is not in a vehicle, 0 driver, 1 co-driver, 2&3 passengers, if the car has enough seats).


Image:32px-Ambox_warning_orange.png Note: Sometimes result can be 128 which is an invalid seat id. Circumstances of this are not yet known, but it is best to discard information when returned seat number is 128


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 may be useful, as they are related to this function in one way or another.

Personal tools