13.10.2009, 21:55
Do it like this
pawn Код:
forward IsVehicleOccupied(vehicleid);
if(strcmp(cmd, "/respawncars", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >=3)
for(new i=0;i<MAX_VEHICLES;i++)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(i);
}
}
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"[AdminCmd]: All vehicles respawned by Admin : %s",playername);
SendClientMessageToAll(Admin, string);
return 1;
}
public IsVehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}