04.06.2011, 00:57
Mm; I guess you could do something like:
Usage: GetVehicleDriver(vehicleid)
if the vehicle is occupied. It will return the drivers player id. If it is not occupied it will return INVALID_PLAYER_ID.
pawn Код:
stock GetVehicleDriver(vid)
{
for(new i; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerVehicleID(i) == vid && GetPlayerSeat(playerid) == 0) return i;
}
return INVALID_PLAYER_ID;
}
if the vehicle is occupied. It will return the drivers player id. If it is not occupied it will return INVALID_PLAYER_ID.