08.01.2013, 16:13
(
Последний раз редактировалось [DOG]irinel1996; 08.01.2013 в 16:59.
)
Someone suggested this for SA-MP 0.3x, so I tried to make it:
Returns:
x -> player's id who is seated on the seatid.
INVALID_VEHICLE_ID -> the vehicle doesn't exist.
INVALID_PLAYER_ID -> the seatid is empty.
PD: I didn't test it, but I guess it should work.
Best regards!
EDIT: Tested.
pawn Код:
stock GetVehiclePlayerInSeat(vehicleid, seatid) {
if (!GetVehicleModel(vehicleid)) return INVALID_VEHICLE_ID;
new
total = GetMaxPlayers()
;
for (new x; x < total; x++) {
if (IsPlayerConnected(x)) {
if (IsPlayerInAnyVehicle(x) && GetPlayerVehicleSeat(x) == seatid) {
return x; //Thanks ****** for making me notice this. (player id 0 issue)
break;
}
}
}
return INVALID_PLAYER_ID; //Thanks Slice
}
x -> player's id who is seated on the seatid.
INVALID_VEHICLE_ID -> the vehicle doesn't exist.
INVALID_PLAYER_ID -> the seatid is empty.
PD: I didn't test it, but I guess it should work.
Best regards!
EDIT: Tested.