Raised This Month: $51 Target: $400
 12% 

small help with amx_ban


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cader
Senior Member
Join Date: Mar 2007
Old 05-26-2009 , 14:39   small help with amx_ban
Reply With Quote #1

Hello.

amx_ban command of my AMXX version requests 3 parameters.

<name or userid>
<minutes>
<reason>

but I don't want to type that other 2 unnecessary arguments. I want only nickname to be requested by amx_ban

I modified the code from admincmd.amx, but it still wants one argument more (like: amx_ban Player 5)

PHP Code:
public cmdBan(idlevelcid)
{
     if (!
cmd_access(idlevelcid3))
          return 
PLUGIN_HANDLED

     
new target[32]

     
read_argv(1target31)
//   read_argv(2, minutes, 7)
//   read_argv(3, reason, 63)


     
new player cmd_target(idtarget9)


     if (!
player)
          return 
PLUGIN_HANDLED

     
new authid[32], name2[32], authid2[32], name[32]
     new 
userid2 get_user_userid(player)

     
get_user_authid(playerauthid231)
     
get_user_authid(idauthid31)
     
get_user_name(playername231)
     
get_user_name(idname31)

     
log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^""nameget_user_userid(id), authidname2userid2authid2)

     new 
temp[64], banned[16]

     
format(temp63"%L"player"PERM")

     
format(banned15"%L"player"BANNED")

     new 
ipa[32]
     
get_user_ip(playeripa311)


     
server_cmd("kick #%d; addip %d %s;writeip"userid2180ipa)



     new 
activity get_cvar_num("amx_show_activity")
     if (
activity != 0)
     {
          new 
players[32], pnummsg[256], len
          get_players
(playerspnum"c")

          for (new 
0pnumi++)
          {
               
len format(msg255"%L"players[i], "ADMIN")

               if (
activity == 1)
                    
len += copy(msg[len], 255-len":")
               else
                    
len += format(msg[len], 255-len" %s:"name)

               
len += format(msg[len], 255-len" %L"players[i], "BAN")
               
len += format(msg[len], 255-len" %s "name2)

               
format(msg[len], 255-len"%L"players[i], "PERM")

               
client_print(players[i], print_chat"%s"msg)
          }
     }
     
console_print(id"[SERVER] %L"id"CLIENT_BANNED"name2)

     return 
PLUGIN_HANDLED

Cader is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 05-26-2009 , 15:58   Re: small help with amx_ban
Reply With Quote #2

if (!cmd_access(id, level, cid, 3))
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
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 05:10.


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