Raised This Month: $ Target: $400
 0% 

Getting Eror


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tm
Member
Join Date: Jun 2005
Old 04-10-2006 , 02:45   Getting Eror
Reply With Quote #1

Delete

Last edited by tm; 10-14-2011 at 12:18.
tm is offline
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 04-10-2006 , 03:01  
Reply With Quote #2

Code:
            }         }     }
__________________
FatalisDK is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 04-10-2006 , 08:07  
Reply With Quote #3

Code:
#include <amxmodx> public plugin_init() {     register_plugin("AMX Force Rates", "1.0", "Taher Ali")     register_cvar("amx_force_rates","1")     register_cvar("force_rate","5500")     register_cvar("force_cmdrate","30")     register_cvar("force_updaterate","20")     register_cvar("force_fpsmax","100")     register_cvar("force_dev","1")         set_task(1.0,"check",_,_,_,"b") } public check() {     new Player[32], PlayerCount     get_players(Player, PlayerCount)     for ( new i = 0 ; i <= PlayerCount ; i++ ) {         if( is_user_connected(Player[i]) && !( get_user_flags(Player[i]) & ADMIN_IMMUNITY) ) {             client_cmd(Player[i],"rate %d",get_cvar_pointer("force_rate"))             client_cmd(Player[i],"cl_cmdrate %d",get_cvar_pointer("force_cmdrate"))             client_cmd(Player[i],"cl_updaterate %d",get_cvar_pointer("force_updaterate"))             client_cmd(Player[i],"fps_max %d",get_cvar_pointer("force_fpsmax"))             client_cmd(Player[i],"developer %d",get_cvar_pointer("force_dev"))         }     } }
[ --<-@ ] Black Rose is offline
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
nhdriver4
Senior Member
Join Date: Nov 2005
Old 04-10-2006 , 09:52  
Reply With Quote #5

Quote:
Originally Posted by Hawk552
Black Rose, you're an idiot.
Wow... that's realy nice of you.
__________________
nhdriver4 is offline
Send a message via AIM to nhdriver4
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-10-2006 , 09:54  
Reply With Quote #6

Quote:
Originally Posted by nhdriver4
Quote:
Originally Posted by Hawk552
Black Rose, you're an idiot.
Wow... that's realy nice of you.
I have no problem with people being idiots, but he should learn how to script first before he goes off and helps people when he has no clue what he's doing.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
nhdriver4
Senior Member
Join Date: Nov 2005
Old 04-10-2006 , 10:10  
Reply With Quote #7

So under your presumptions, it's reasonable to assume that tm is also an idiot?

People try to the best of their abilities to help. That's what this forum is all about. You shouldn't give people a hard time for trying to be helpfull.
__________________
nhdriver4 is offline
Send a message via AIM to nhdriver4
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-10-2006 , 10:12  
Reply With Quote #8

Quote:
Originally Posted by nhdriver4
So under your presumptions, it's reasonable to assume that tm is also an idiot?

People try to the best of their abilities to help. That's what this forum is all about. You should give people a hard time for trying to be helpfull.
No, because tm is not trying to help other people. Black Rose was spreading wrong information in this thread, which is ultimately why I called him an idiot. I don't care if he was trying, he was wrong.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
nhdriver4
Senior Member
Join Date: Nov 2005
Old 04-10-2006 , 10:16  
Reply With Quote #9

I guess it comes with the old age... Anyways, you win.
__________________
nhdriver4 is offline
Send a message via AIM to nhdriver4
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 04-10-2006 , 10:18  
Reply With Quote #10

Quote:
Originally Posted by nhdriver4
I guess it comes with the old age... Anyways, you win.
what's that sonny, speak up i can't hear you
(C) Greentryst 2003(?). All rights reserved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 16:34.


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