GetPlayerVehicleSeat
From SA-MP Wiki
(Difference between revisions)
| 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
Find out what seat a player is in.
(playerid)
| playerid | The ID of the player you want to get the seat of. |
| 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 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.
- GetPlayerVehicleID: Get the ID of the vehicle the player is in.
- PutPlayerInVehicle: Put a player in a vehicle.
