Raised This Month: $ Target: $400
 0% 

Some problem in my plugin (may be Two Dimensional Arrays problem)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ryo89589
Member
Join Date: Aug 2011
Old 06-14-2014 , 14:30   Some problem in my plugin (may be Two Dimensional Arrays problem)
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
new plugin_enabledpip[65][22]
 
public 
plugin_init()
{
 
plugin_enabled register_cvar("amx_betasys""0")
 
register_concmd("amx_addpass""addpass"ADMIN_RCON"<playername|auth> - add specified player as a pass user")
 
register_concmd("amx_delpass""delpass"ADMIN_RCON"<playername|auth> - delete specified player as a pass user")
}
 
public 
client_authorized(id)
 return 
get_pcvar_num(plugin_enabled) ? checkUser(id) : PLUGIN_CONTINUE
 
public delayed_kick(user[])
 
server_cmd("kick #%d"user[0])
 
public 
checkUser(id)
{
 new 
serip[22], userip[22]
 
get_user_ip(0seripcharsmax(serip), 1)
 
get_user_ip(iduseripcharsmax(userip), 1)
 
 if( 
equal(userippip[0], 21) )
  return 
PLUGIN_HANDLED
 
 
new userid[3]
 
userid[0] = get_user_userid(id)
 
set_task(0.1"delayed_kick"0userid1)
 
 return 
PLUGIN_CONTINUE
}
 
public 
addpass(idlevelcid)
{
 if (!
cmd_access(idlevelcid2))
  return 
PLUGIN_HANDLED
 
 
new name[33], ip[22], arg[33]
 
read_argv(1arg32)
 
get_user_name(idnamecharsmax(name))
 
get_user_ip(idipcharsmax(ip))
 
 if( !
equal(argpip[0], 21) )
  
copy(pip[0], charsmax(arg), arg)
 
 return 
PLUGIN_HANDLED
}
 
public 
delpass(idlevelcid)
{
 if (!
cmd_access(idlevelcid2))
  return 
PLUGIN_HANDLED
 
 
new name[33], ip[22], arg[22]
 
read_argv(1argcharsmax(arg))
 
get_user_name(idnamecharsmax(name))
 
get_user_ip(idipcharsmax(ip))
 
 if( 
equal(argpip[0], 21) )
  
copy(pip[0], 0"")
 
 return 
PLUGIN_HANDLED

When I delete an IP, all IP will be affected.
I think "delpass" There are some problems.
Please help me to check for problems. Thank you!

Also, please help me to check all two-dimensional array.
Are there any problems? Thank you very much!

Last edited by ryo89589; 06-14-2014 at 14:32.
ryo89589 is offline
 



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 21:17.


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