Raised This Month: $ Target: $400
 0% 

Run Command Ever 30 Seconds


Post New Thread Reply   
 
Thread Tools Display Modes
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 02-27-2006 , 00:28  
Reply With Quote #11

i was browsing through old posts looking for interesting requests and came upon this. i thought i'd explain why it doesn't work.

defining something causes it to be replace by the preprocessor before the compiler actually checks the code. so basically your code is looking like this:

Code:
#include <amxmodx> #define sv_stepsize 18 // here you can adjust stepsize new Float:seconds=30.0 // here you can change the seconds public plugin_init(){     register_plugin("Timer","0.1","KoST")     //set_task(seconds,"MyTimer") [edit]     set_task(seconds,"MyTimer",0,"",0,"b") } public MyTimer(){     new step_size=get_cvar_num("18")     if (step_size!=18) {         set_cvar_num("18",18)     } }

just change the name of the define from sv_stepsize to defaultsize or something, and then replace it in the if statement and set_cvar_num. sorry for the necro-post.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
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 07:36.


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