Raised This Month: $ Target: $400
 0% 

Help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mihai_tdog
New Member
Join Date: Jan 2007
Old 01-15-2007 , 18:27   Help please
Reply With Quote #1

Can anyone tell me how to delay the execution of an instruction in a script just for a few seconds ?Is there a command (like delay() in Borland Pascal) to do that ?I`m a newbie so ....please help.
Pls mail to [email protected]
thanks a lot

Last edited by mihai_tdog; 01-15-2007 at 18:29.
mihai_tdog is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-15-2007 , 19:02   Re: Help please
Reply With Quote #2

Code:
set_task(Float:delay, "function to execute")

Example:
Code:
func() {     set_task(1.0, "func2") } public func2() {     // this is called after 1 second. }

Transfer data from first func:
Code:
func(id) {     new param[3]     param[0] = 'l'     param[1] = 2     param[2] = id     set_task(1.0, "func2", 0, param, 3) } public func2(param[]) {     new c = param[0]     new i = param[1]     new id = param[2] }

Last edited by [ --<-@ ] Black Rose; 01-15-2007 at 19:07.
[ --<-@ ] Black Rose is offline
Old 01-16-2007, 00:45
quick
This message has been deleted by sawce the snail. Reason: spam
Old 01-16-2007, 02:00
Bad_Bud
This message has been deleted by sawce the snail. Reason: reply to spam
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 01-16-2007 , 11:30   Re: Help please
Reply With Quote #5

mihai_tdog, you should forget about delay/sleep functions within amx/x because HL is a real-time application. Your plugin should work as fast as possible because they are called SEQUENTALLY.
Simon Logic is offline
Send a message via Skype™ to Simon Logic
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-16-2007 , 16:03   Re: Help please
Reply With Quote #6

That depends on what you wanna do really...
If there were no need for set_task it wouldn't exist.
[ --<-@ ] Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode