Raised This Month: $ Target: $400
 0% 

People lose access?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-21-2005 , 14:03   People lose access?
Reply With Quote #1

On my server I made this plugin
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Hook Set", "1.0", "DataMatrix")     register_concmd("amx_hook","cmdHook",ADMIN_LEVEL_A,"0 = Disable | 1 = Enable") } public cmdHook(id,level,cid) {     if (!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[32],name[32]     read_argv(id,arg,31)     get_user_name(id,name,31)     if (equal(arg,"0")==1) {         set_cvar_num("df_hook_on",0)     } else if (equal(arg,"1")==1) {         set_cvar_num("df_hook_on",1)     } else {         client_print(id,print_console,"[AMXX] Invalid arguement: %s",arg)     }     switch(get_cvar_num("amx_show_activity"))   {         case 1: client_print(0,print_chat,"[AMXX] ADMIN: set hook to %s",arg)         case 2: client_print(0,print_chat,"[AMXX] ADMIN %s: set hook to %s",name,arg)         }     return PLUGIN_CONTINUE }
Sometimes I will type in "amx_hook 1" and it will enable hook saying:
"[AMXX] ADMIN DataMatrix: set hook to 1"

Then maybe after a while I or other admins will try "amx_hook 0" or something and it will say:
"[AMXX] ADMIN DataMatrix: set hook to "

It doesn't disable or work most of the time, I've looked top to bottom and find no problems of my own.

Any help appreciated.
DataMatrix is offline
Send a message via MSN to DataMatrix
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 08-21-2005 , 14:18  
Reply With Quote #2

change:
Code:
read_argv(id,arg,31)

to:
Code:
read_argv(0,arg,31)

see if that helps.

also, I'm not sure if this'll help either, but eh, you can try it:

Code:
register_cvar("df_hook_on","0",ADMIN_LEVEL_A,"0 = Disable | 1 = Enable")
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-21-2005 , 14:41  
Reply With Quote #3

Now it says:
"[AMXX] ADMIN DataMatrix: set hook to amx_hook"
DataMatrix is offline
Send a message via MSN to DataMatrix
DahVid
Senior Member
Join Date: Jun 2005
Old 08-21-2005 , 14:43  
Reply With Quote #4

*sigh*
read_argv(1,arg,31)

The plugin was reading amx_hook, now it should read

amx_hook *Read*
DahVid is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 08-21-2005 , 14:43  
Reply With Quote #5

it should 1, not 0
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 08-21-2005 , 14:51  
Reply With Quote #6

whoops. my bad, lol
0 is the command it-self 1+ are the arguements
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-21-2005 , 14:53  
Reply With Quote #7

Ahh, brilliant, thanks guys!
DataMatrix is offline
Send a message via MSN to DataMatrix
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 14:31.


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