Autorace should start every 15 minutes
#2

So i've looked into the code a bit, it shouldn't be that hard to make.

At the function StopRace() there is a line which says the following:
pawn Код:
if(AutomaticRace == true) LoadRaceNames(), LoadAutoRace(RaceNames[random(TotalRaces)]);
In this line you should replace the loadrace parts with a timer of 900 000 milliseconds.
So the line would be like this:
pawn Код:
SetTimerEx("NextAutoRaceTimer", 900000, false, ""); // the false to make it not repeat, as you only want to start the timer when the previous race is finished
So that line would now look like:
pawn Код:
if(AutomaticRace == true) SetTimerEx("NextAutoRaceTimer", 900000, false, "");
In the top of the script you should add:
pawn Код:
forward NextAutoRaceTimer();
To actually make the timer do shit, you should make the NextAutoRaceTimer stuff.
Which will be the following:

pawn Код:
public NextAutoRaceTimer()
{
 LoadRaceNames()
 LoadAutoRace(RaceNames[random(TotalRaces)]);
}
Some more explanation:

Once a race finishes StopRace is being called. In here you add a timer of 15 minutes, once this finishes, you call the next function which starts a new one.

I haven't tested this, as i didn't unpack all the files, but this is how i do it in my own scripts, and it has never let me down

-TG
Reply


Messages In This Thread
Autorace should start every 15 minutes - by Rohit12 - 23.08.2017, 12:44
Re: Autorace should start every 15 minutes - by thegamer355 - 23.08.2017, 13:58
Re: Autorace should start every 15 minutes - by Rohit12 - 23.08.2017, 17:47
Re: Autorace should start every 15 minutes - by thegamer355 - 23.08.2017, 18:55
Re: Autorace should start every 15 minutes - by Rohit12 - 23.08.2017, 20:39
Re: Autorace should start every 15 minutes - by thegamer355 - 24.08.2017, 06:07
Re: Autorace should start every 15 minutes - by Rohit12 - 24.08.2017, 12:01
Re: Autorace should start every 15 minutes - by thegamer355 - 24.08.2017, 12:15
Re: Autorace should start every 15 minutes - by Rohit12 - 25.08.2017, 22:10

Forum Jump:


Users browsing this thread: 1 Guest(s)