06.02.2010, 19:48
Hello guys and girls, I need help to make a timer on /respawnallcars.
It should be 30 seconds and then the cars should respawn.
Thanks for all answers
Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " 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), "All unused cars has been respawned by administrator %s.", sendername);
SendClientMessageToAll(COLOR_RED, string);
}
return 1;
}
Thanks for all answers


