Raised This Month: $ Target: $400
 0% 

wait between two events


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kakarotto
Senior Member
Join Date: Apr 2014
Old 07-17-2014 , 01:40   wait between two events
Reply With Quote #1

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

Last edited by YamiKaitou; 10-12-2014 at 13:51.
Kakarotto is offline
Old 07-17-2014, 01:43
Eagle07
This message has been deleted by Eagle07.
Kakarotto
Senior Member
Join Date: Apr 2014
Old 07-17-2014 , 01:45   Re: wait between two events
Reply With Quote #3

he told me that i should post here when i ask for help -____-

Last edited by YamiKaitou; 10-12-2014 at 13:52.
Kakarotto is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-17-2014 , 01:57   Re: wait between two events
Reply With Quote #4

Quote:
Originally Posted by Kakarotto View Post
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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-17-2014 , 01:54   Re: wait between two events
Reply With Quote #5

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"

__________________

Last edited by Eagle07; 07-17-2014 at 01:55.
Eagle07 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-17-2014 , 03:59   Re: wait between two events
Reply With Quote #6

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... 
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
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 13:15.


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