SA-MP Forums Archive
sleep - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: sleep (/showthread.php?tid=79117)



sleep - russiany - 25.05.2009

Why sleep fuction has been broken by SA:MP TEAM ?


Re: sleep - Castle - 25.05.2009

What are you talking about!? I never saw any Sleep function


Re: sleep - Correlli - 25.05.2009

I don't think there was a sleep function in SA-MP.


Re: sleep - MenaceX^ - 25.05.2009

Quote:
Originally Posted by Castle
What are you talking about!? I never saw any Sleep function
Newbies don't know.
It's a diffecoult question. I often see people use the sleep function, though many people don't even know it.
Abit info if I remember it well:
sleep - keyword sleep.
Sleep is like timer that works for main() only.
pawn Код:
print("Now it's starting to \"sleep\"");
sleep(10000);
print("10 seconds passed of \"sleep\"");
I guess you could understand it alone, it's very simple to use. Everyone can understand it.


Re: sleep - russiany - 26.05.2009

I know this , rofl xD i know c++ too , but i don't know why SA:MP Team has broken this function. It was nice xD


Re: sleep - MenaceX^ - 26.05.2009

Quote:
Originally Posted by russiany
I know this , rofl xD i know c++ too , but i don't know why SA:MP Team has broken this function. It was nice xD
I didn't know that it got fucked up too in 0.2X, though I never meet someone that used this


Re: sleep - MenaceX^ - 26.05.2009

Quote:
Originally Posted by JeNkStAX
Pawn is only Single Threaded, Therefor its not possible to have a sleep function without halting everything else from going on in the script, SA:MP didnt "break" it, Its just how Pawn is, The only place sleep has and ever will work is in main().
Like I said in my first reply - This function can be used ONLY in main().


Re: sleep - russiany - 26.05.2009

Ok , use it in main , and start the server. Tell me what happend


Re: sleep - woot - 26.05.2009

https://sampwiki.blast.hk/wiki/Code_Snippets#Halt


Re: sleep - yom - 26.05.2009

Quote:
Originally Posted by //exora
Yes, there is a big load of crap on the wiki.