22.01.2019, 14:07
Troque sua callback por essa:
E use assim:
Fiz pela lуgica, nгo testei.
PHP код:
stock GetEmptyVehicleSeat(vehicleid)
{
new Seat[4];
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid))
{
if(GetPlayerVehicleSeat(i) == 0) Seat[0] = true;
if(GetPlayerVehicleSeat(i) == 1) Seat[1] = true;
if(GetPlayerVehicleSeat(i) == 2) Seat[2] = true;
if(GetPlayerVehicleSeat(i) == 3) Seat[3] = true;
}
}
}
for(new a; a < sizeof(Seat); a++)
{
if(Seat[a] == false) return false;
}
return true;
}
E use assim:
PHP код:
if(!GetEmptyVehicleSeat(vehicleid)) return SendClientMessage(playerid, -1, "Veiculo cheio.");
Fiz pela lуgica, nгo testei.