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