AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   wait between two events (https://forums.alliedmods.net/showthread.php?t=244344)

Kakarotto 07-17-2014 01:40

wait between two events
 
is there a way to make wait time from code to another
for example

PHP Code:

server_cmd ("pb_minbots 3")
wait 1 minute
server_cmd 
("pb_minbots 6")
wait 2 minutes
server_cmd 
("pb_minbots 11")

. . . 

Thanks

Kakarotto 07-17-2014 01:45

Re: wait between two events
 
he told me that i should post here when i ask for help -____-

Eagle07 07-17-2014 01:54

Re: wait between two events
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new bool:aaa[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("round_start"2"0=World triggered""1=Round_Start")
}
public 
round_start(id)
{
    if(!
aaa[id]) 
    {
        
aaa[id] = true;
        
server_cmd ("pb_minbots 3"
        
set_task(60.0,"bot1",id)
    }
}
public 
bot1(id)
{
    
server_cmd ("pb_minbots 6"
    
set_task(120.0,"bot1",id)
}
public 
bot2(id)
{
    
server_cmd ("pb_minbots 11"



YamiKaitou 07-17-2014 01:57

Re: wait between two events
 
Quote:

Originally Posted by Kakarotto (Post 2169083)
he told me that i should post here when i ask for help -____-

Then you Report the thread and ask for it to be moved. DO NOT make a new thread

Flick3rR 07-17-2014 03:59

Re: wait between two events
 
Eagle07, please avoid posting ready-made codes here. Atleast this is Scripting Help section, so the people must know what they are doing. Especially here, for something that simple, you could easily explain.
However, the code shows that you have to simply use tasks to set a time for executing some action.
Example:
PHP Code:

//Doing something
set_task(60.0//....

public TaskFunction1
//Doing something 60 seconds afer the first something
set_task(120.0//.....

public TaskFunction2
//Doing something 120 seconds after the seconds something, and 180 seconds after the first something
//Etc... 



All times are GMT -4. The time now is 13:15.

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