Raised This Month: $ Target: $400
 0% 

need help [pause]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sewq11
Junior Member
Join Date: Oct 2009
Old 10-20-2009 , 04:26   need help [pause]
Reply With Quote #1

hi,

i made a plugin and i need to know how to make the server pause and unpaused after 30 sec

i tried
server_cmd("amx_pause")
set_task(30.0,"unpause")

public unpause()
{
server_cmd("amx_pause")

}

but it never seems to go to unpause, probabley because the plugin is paused allso.

help ?
sewq11 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 08:29   Re: need help [pause]
Reply With Quote #2

As much as I hate encouraging it, try this:

Code:
server_cmd( "alias w10 ^"wait;wait;wait;wait;wait;wait;wait;wait;wait;wait^"" )
server_cmd( "alias w100 ^"w10;w10;w10;w10;w10;w10;w10;w10;w10;w10^"" )
server_cmd( "alias w1000 ^"w100;w1000;w100;w100;w100;w100;w100;w100;w100;w100^"" )
server_cmd( "amx_pause; w1000; amx_pause" )
You'll have to screw around with that. I'm about 75% sure that 1000 waits equates to only like 5 seconds.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-20-2009 , 10:03   Re: need help [pause]
Reply With Quote #3

Quote:
Originally Posted by Hawk552 View Post
I'm about 75% sure that 1000 waits equates to only like 5 seconds.
It depends from server fps
__________________
xPaw is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 10:17   Re: need help [pause]
Reply With Quote #4

Quote:
Originally Posted by xPaw View Post
It depends from server fps
Yeah, I think each wait takes a tick. That would make this extremely unreliable, but I can't think of any other way to do it.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
sewq11
Junior Member
Join Date: Oct 2009
Old 10-20-2009 , 10:31   Re: need help [pause]
Reply With Quote #5

thq... ill do that
sewq11 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-20-2009 , 10:39   Re: need help [pause]
Reply With Quote #6

Quote:
Originally Posted by sewq11 View Post
thq... ill do that
There's some hackish calculation I can probably throw together using server_frame() to figure out how many waits should be executed, but it'll be a pain to write. If it doesn't need to be precise, what I gave you should more or less work.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply


Thread Tools
Display Modes

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 17:33.


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