Despawn all unused vehicles
#2

if(strcmp(cmd, "/respawnallcars", true) == 0 )
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
new bool:unwanted[CAR_AMOUNT];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 268; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
BroadCast(COLOR_WHITE,string);
}
return 1;
}
Reply


Messages In This Thread
Despawn all unused vehicles - by Garc1a - 06.06.2012, 15:38
Re: Despawn all unused vehicles - by mahdi499 - 06.06.2012, 15:42
Re: Despawn all unused vehicles - by zombieking - 06.06.2012, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)