Timer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer (
/showthread.php?tid=647139)
Timer -
Hunud - 30.12.2017
I'm using Ryder's race sys.
The problem is with the timer, It won't run a random race. Nothing happen. What i am doing wrong ?
OnFilterScriptInit
Код:
SetTimer("Start_autorace", 60000, true);
Код:
function Start_autorace( )
{
LoadRaceNames( ), LoadAutoRace( RaceNames[ random( TotalRaces ) ] );
return 1;
}
Re: Timer -
Sew_Sumi - 30.12.2017
Код:
function Start_autorace( )
{
print("Function Start_autorace invoked");
LoadRaceNames( ), LoadAutoRace( RaceNames[ random( TotalRaces ) ] );
return 1;
}
Check it is indeed starting the function, if that works, then check the random that it's obtaining and print that out using printf.
Re: Timer -
TakeiT - 30.12.2017
function Start_autorace( )
needs to be:
Код:
forward Start_autorace( );
public Start_autorace( )
Re: Timer -
Zeth - 30.12.2017
Quote:
Originally Posted by TakeiT
function Start_autorace( )
needs to be:
Код:
forward Start_autorace( );
public Start_autorace( )
|
There maybe a macro defined for forward and public, thats not the error.
Re: Timer -
Hunud - 30.12.2017
It doesen't work and printf sending "Function Start_autorace invoked" .
Re: Timer -
Hunud - 30.12.2017
BUMP!
+REP if helped.
Re: Timer -
rfr - 30.12.2017
pawn Код:
SetTimer("Start_autorace", 60000, true);
forward Start_autorace();
public Start_autorace()
{
//code here
}
Re: Timer -
Hunud - 30.12.2017
Quote:
Originally Posted by rfr
pawn Код:
SetTimer("Start_autorace", 60000, true);
forward Start_autorace(); public Start_autorace() { //code here }
|
Don't you see there is already functions
LoadRaceNames( ), LoadAutoRace( RaceNames[ random( TotalRaces ) ] );
Re: Timer -
Ritzy2K - 30.12.2017
Quote:
Originally Posted by Hunud
It doesen't work and printf sending "Function Start_autorace invoked" .
|
Meaning that your function is getting called, but races aren't loading. Check Sew's reply again. He covered it all what you needed.
Also wtf is -
"BUMP"
"+REP if I helped"?
Re: Timer -
Hunud - 30.12.2017
I did what he said, stil it doesen't work as expected.