Raised This Month: $ Target: $400
 0% 

random set_task timer.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-16-2013 , 08:24   Re: random set_task timer.
Reply With Quote #5

this is just a quick code... im not best at explaining things but here goes
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(PLUGIN, VERSION, AUTHOR)         g_iTaskTimer = ( random_float( 15.0, 30.0 ) ); // execute random number for first time     set_task( g_iTaskTimer, "FunctionSetTask" ); // just example for calling first task. } public FunctionSetTask( id ) {     //.. commands or what ever in here             // then set task again with random number     g_iTaskTimer = ( random_float( 15.0, 30.0 ) ); // get random number before setting task.     set_task( g_iTaskTimer, "FunctionSetTask", id ); // set same task with NEW random number } /* calling random_float before set_task in the FunctionSetTask will always change the number to random
__________________
Blizzard_87 is offline
 



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