17.12.2014, 16:26
pawn Код:
CMD:respawnallcars(playerid)
{
new string[128];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to do this!");
return 1;
}
new bool:unwanted[MAX_VEHICLES];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= MAX_VEHICLES; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
format(string, sizeof(string), "SERVER: All unused cars were respawned by %s", sendername);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}