Raised This Month: $ Target: $400
 0% 

Getting Eror


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-10-2006 , 09:24  
Reply With Quote #4

Black Rose, you're an idiot. get_cvar_pointer returns a pointer, it does not return the real value of the cvar.

EDIT: On top of that, you're using a set_task, which happens to be slower than client_PreThink.

Try this:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> new pon new pforce_rate new pforce_cmdrate new pforce_updaterate new pforce_fpsmax new pforce_dev public plugin_init() {     register_plugin("AMX Force Rates", "1.0", "Taher Ali")     pon = register_cvar("amx_force_rates","1")     register_concmd("amx_force_rates", "fnMode", ADMIN_BAN, "<1 = enable, 0 = disable>")     pforce_rate = register_cvar("force_rate","5500")     pforce_cmdrate = register_cvar("force_cmdrate","30")     pforce_updaterate = register_cvar("force_updaterate","20")     pforce_fpsmax = register_cvar("force_fpsmax","100")     pforce_dev = register_cvar("force_dev","1")     } public fnMode(id,level,cid) {     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         set_pcvar_num(pon,get_pcvar_num(pon) ? 0 : 1)         client_print(id,print_console,"Force mode has been toggled.")         return PLUGIN_HANDLED } public client_PreThink(id)     if(is_user_connected(id) && !(get_user_flags(id) & ADMIN_IMMUNITY) && get_pcvar_num(pon))     {         client_cmd(id,"rate %d",get_pcvar_num(pforce_rate))         client_cmd(id,"cl_cmdrate %d",get_pcvar_num(pforce_cmdrate))         client_cmd(id,"cl_updaterate %d",get_pcvar_num(pforce_updaterate))         client_cmd(id,"fps_max %d",get_pcvar_num(pforce_fpsmax))         client_cmd(id,"developer %d",get_pcvar_num(pforce_dev))     }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 16:33.


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