Sign in to follow this  
Followers 0
RASTAMAN

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

1 post in this topic

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

Спойлер

#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

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Guest володя
      By Guest володя
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(67) : warning 215: expression has no effect
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(114 -- 121) : error 001: expected token: "-string end-", but found "-identifier-"
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121) : warning 217: loose indentation
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121) : warning 215: expression has no effect
      C:\Users\vilin\Desktop\Hot RP\gamemodes\hot.pwn(121 -- 124) : warning 215: expression has no effect
      Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase

      1 Error.
      Вот код: