16.08.2010, 17:38
I got this command for admins which calls this Stock, When i do it, even if a player is in the car it still respawns the car. It's only suppose to respawn cars that people are not in. Whats wrong with the code? I don't see anything wrong with it
pawn Код:
if(strcmp(cmd, "/resallemptycars", true) == 0) {
if(PlayerInfo[playerid][pAdmin] >= 3) {
RespawnAllEmptyCars();
SendClientMessageToAll(COLOR_RED, "[ADMIN] An Admin Has respawned all the empty cars");
return 1;
}
}
pawn Код:
stock RespawnAllEmptyCars()
{
for(new i = 0; i < GetMaxPlayers(); i++)
for(new v;v<MAX_VEHICLES;v++)
if(!IsPlayerInVehicle(i, v))SetVehicleToRespawn(v);
}