AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help [pause] (https://forums.alliedmods.net/showthread.php?t=106894)

sewq11 10-20-2009 04:26

need help [pause]
 
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 ?

Hawk552 10-20-2009 08:29

Re: need help [pause]
 
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.

xPaw 10-20-2009 10:03

Re: need help [pause]
 
Quote:

Originally Posted by Hawk552 (Post 967597)
I'm about 75% sure that 1000 waits equates to only like 5 seconds.

It depends from server fps

Hawk552 10-20-2009 10:17

Re: need help [pause]
 
Quote:

Originally Posted by xPaw (Post 967649)
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.

sewq11 10-20-2009 10:31

Re: need help [pause]
 
thq... ill do that

Hawk552 10-20-2009 10:39

Re: need help [pause]
 
Quote:

Originally Posted by sewq11 (Post 967656)
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.

sewq11 10-20-2009 11:25

Re: need help [pause]
 
as along as it is somewhere around 25-35 sec im allrgt


All times are GMT -4. The time now is 17:33.

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