05.09.2014, 07:49
pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(playerVariables[playerid][pAdminLevel] < 3)
{
SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
return 1;
}
new samp[256];
SetTimer("RACtime", 3000, 0);
format(samp, 256,"{FFFFFF}All unused cars well be respawned in {009999}3 {FFFFFF}seconds by %s!",playerVariables[playerid][pNormalName]);
submitToAdmins(samp, -1);
}
return 1;
}
pawn Код:
public ractime(playerid)
{
new string[256];
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 <= MAX_VEHICLES; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
return 1;
}
pawn Код:
public RACtime(playerid)
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(!IsVehicleOccupied(player)) SetVehicleToRespawnEx(player);
}
for(new car = 1; car <= 1300; car++)
{
if(!IsVehicleOccupied(car)) SetVehicleToRespawnEx(car);
}
return 1;
}