AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting Eror (https://forums.alliedmods.net/showthread.php?t=26847)

tm 04-10-2006 02:45

Getting Eror
 
Delete

FatalisDK 04-10-2006 03:01

Code:
            }         }     }

[ --<-@ ] Black Rose 04-10-2006 08:07

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"))         }     } }

Hawk552 04-10-2006 09:24

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))     }

nhdriver4 04-10-2006 09:52

Quote:

Originally Posted by Hawk552
Black Rose, you're an idiot.

Wow... that's realy nice of you.

Hawk552 04-10-2006 09:54

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.

nhdriver4 04-10-2006 10:10

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.

Hawk552 04-10-2006 10:12

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.

nhdriver4 04-10-2006 10:16

I guess it comes with the old age... Anyways, you win.

Hawk552 04-10-2006 10:18

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.


All times are GMT -4. The time now is 16:33.

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