Reset cars
#2

pawn Код:
public OnGameModeInit()
{
    SetTimer("respawncars", 3600000, true);
    return 1;
}

forward respawncars();
public respawncars()
{
    format(string, sizeof(string), "INFO: All unused vehicles have been respawned.");
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        {
            SendClientMessage(i, COLOR_LIGHTBLUE, string);
        }
    }
    new bool:unwanted[CAR_AMOUNT];
    foreach (Player,player)
    {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
    }
    for(new car = 0; car < MAX_VEHICLES; car++)
    {
        if(!unwanted[car])
        {
            RespawnAllCars(car);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Reset cars - by sirvanec - 28.03.2015, 19:11
Re: Reset cars - by Affan - 28.03.2015, 19:28

Forum Jump:


Users browsing this thread: 2 Guest(s)