Raised This Month: $ Target: $400
 0% 

random set_task timer.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-17-2013 , 07:30   Re: random set_task timer.
Reply With Quote #9

Quote:
Originally Posted by Blizzard_87 View Post
No.
Reason. YamiKaitou said above.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Random SetTask Number"
#define VERSION "1.0"
#define AUTHOR "Blizzard"

new Float:g_iTaskTimer// set as global float to hold random number.

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_iTaskTimer = ( random_float15.030.0 ) ); // execute random number for first time
    
set_taskg_iTaskTimer"FunctionSetTask" ); // calling first task with a random time.
}

public 
FunctionSetTaskid ) {
    
//.. commands or what ever in here
    
    
    // then set task again with random number
    
g_iTaskTimer = ( random_float15.030.0 ) ); // get random number before setting task.
    
set_taskg_iTaskTimer"Function"id ); // set same task with NEW random number
}

public Function( 
id ) {
    if(
task_exists(id)) {
        
remove_task(id);
        
FunctionSetTask(id);
    }
    
    
/* Do something here */

__________________
I Hate people who can hate me !
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
 



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 06:20.


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