Quote:
Originally Posted by [XST]O_x
pawn Код:
stock GetFreeSeat(vehicleid) { foreach(new i: Player) { if(IsPlayerInAnyVehicle(i) && GetPlayerVehicleID(playerid) == vehicleid) { for(new j = 0; j < 9; j++) { if(GetPlayerVehicleSeat(i) == j) continue; else return j; } return -1; } } return 1; }
Will only work for occupied vehicles though
|
That code wont work at all, first you loop through the players than if you found a player inside the vehicle you get his seatid and if it isn't j (start at 0 goes till

the function returns j
If the seatid of the first person found is 0 than the function will return 1 and if the seatid isn't 0 than it will return 0