Raised This Month: $ Target: $400
 0% 

Banning player by server_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-07-2009 , 19:26   Re: Banning
Reply With Quote #1

try this
PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_concmd ("amx_banning""CmdBan"ADMIN_BAN)
}

public 
CmdBan(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED

    
new s_Name[32]
    
read_argv(1s_Namecharsmax(s_Name))
    new 
i_Target cmd_target (ids_Name2)
    if(!
i_Target)
    {
        
client_print(idprint_console"(!) Player not found")
        return 
PLUGIN_HANDLED
    
}
    
server_cmd("addip 0 %s"i_Target)
    
    return 
PLUGIN_HANDLED

not tested
__________________
alan_el_more is offline
ehha
SourceMod Donor
Join Date: Apr 2006
Location: Sibiu
Old 04-08-2009 , 07:01   Re: Banning
Reply With Quote #2

alan_el_more, you forgot:
Code:
new uIP[32] get_user_ip(i_Target, uIP, 31) server_cmd("addip 0 %s", uIP)
or this in case he wants to ban the SteamID
Code:
new uID[32] get_user_authid(i_Target, uID, 31) server_cmd("banid 0 %s", uID)
ehha is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-08-2009 , 07:43   Re: Banning
Reply With Quote #3

PHP Code:
function( id... )
{
    new 
name33 ];
    
get_user_nameidname32 );
    
server_cmd"amx_ban %s"name );
}
/*
    Then you just set times/reasons how you want etc.
*/ 
SnoW is offline
Send a message via MSN to SnoW
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-08-2009 , 07:45   Re: Banning
Reply With Quote #4

Quote:
Originally Posted by SnoW View Post
PHP Code:
function( id... )
{
    new 
name33 ];
    
get_user_nameidname32 );
    
server_cmd"amx_ban %s"name );
}
/*
    Then you just set times/reasons how you want etc.
*/ 
I think he wanted to do that without using amxx commands ....
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
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 02:22.


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