Raised This Month: $32 Target: $400
 8% 

Sleep()!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-11-2006 , 13:10   Sleep()!
Reply With Quote #1

Is there any matching function for sleep() (For use in a loop to delay it)?
I do not want to use a different function and set_task

Thanks!
__________________
Sig(h)!
Obbin is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-11-2006 , 13:49   Re: Sleep()!
Reply With Quote #2

you could build you own, but eg. when you use sleep in an loop for eg. 2 seconds, then the FULL GAME will stuck for 2 seconds.
so you should use something like set_task if you dont want to do this
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-11-2006 , 14:12   Re: Sleep()!
Reply With Quote #3

Oh okay, it just feels kinda stupid to create a new function for 2 rows of code.
__________________
Sig(h)!
Obbin is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-11-2006 , 14:46   Re: Sleep()!
Reply With Quote #4

Also check out Hawk552's set_task avoidance tutorial
http://forums.alliedmods.net/showthread.php?t=43049
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-11-2006 , 16:31   Re: Sleep()!
Reply With Quote #5

It's really not a good idea to be messing with sleeping. HLDS (as well as AMXX) is single threaded, so when you stall something you're doing, you stall everything.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 09-11-2006 , 17:11   Re: Sleep()!
Reply With Quote #6

Wasn't that what Greenberet said ^_^
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-11-2006 , 17:21   Re: Sleep()!
Reply With Quote #7

Quote:
Originally Posted by MaximusBrood View Post
Wasn't that what Greenberet said ^_^
Not really, he didn't mention about it being single threaded.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-12-2006 , 02:17   Re: Sleep()!
Reply With Quote #8

do you really think that they know what a thread is?
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 09-12-2006 , 09:17   Re: Sleep()!
Reply With Quote #9

Actually, I do
__________________
Sig(h)!
Obbin 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 04:25.


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