1 post in this topic

RASTAMAN
Великий Гуру

Автоматический рескар автомобилей.

Спойлер

#define RESPAWN_TIME_CARS 60 //60 минут

 

Спойлер

new bool:resCar[MAX_VEHICLES];
new timeSec;
new timeMin;

 

Спойлер

if(++timeSec >= 60)
{
    timeSec = 0;
    timeMin ++;
    if(timeMin >= RESPAWN_TIME_CARS)
    {
        SendClientMessageToAll(-1,"Все незанятые авто зареспавнены! В следующий раз, спавн авто будет через "#RESPAWN_TIME_CARS" мин.");
        for(new i = GetMaxPlayers(); i != -1; i--) if(IsPlayerInAnyVehicle(i)) resCar[GetPlayerVehicleID(i)] = true;
        for(new car = 1; car < MAX_VEHICLES; car++) if(!resCar[car]) SetVehicleToRespawn(car);
        timeMin = 0;
    }
}

 

Спойлер

SetTimer("SecondTime",1000,true);

 

Спойлер

forward SecondTime();
public SecondTime()
{
    if(++timeSec >= 60)
    {
        timeSec = 0;
        timeMin ++;
        if(timeMin >= RESPAWN_TIME_CARS)
        {
            SendClientMessageToAll(-1,"Все незанятые авто зареспавнены! В следующий раз, спавн авто будет через "#RESPAWN_TIME_CARS" мин.");
            for(new i = GetMaxPlayers(); i != -1; i--) if(IsPlayerInAnyVehicle(i)) resCar[GetPlayerVehicleID(i)] = true;
            for(new car = 1; car < MAX_VEHICLES; car++) if(!resCar[car]) SetVehicleToRespawn(car);
            timeMin = 0;
        }
    }
}

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Lipsi
      By Lipsi
      Здравствуйте! 
       
      Я ищю людей мапперов скриптеров и так далее! 
       
       Плата будет но не сразу
       
      Связь со мной: 
      ВК - https://vk.ru/lipsi_den
      Тг- @Lipsi_den4ik
      Вконтакте обязательно должен быть у вас!