Raised This Month: $ Target: $400
 0% 

Banning player by server_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-07-2009 , 19:08   Banning player by server_cmd
Reply With Quote #1

How do you ban a player permanently by server_cmd?

like, what would be the code?
BOYSplayCS is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-07-2009 , 19:26   Re: Banning
Reply With Quote #2

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 #3

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 #4

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 #5

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
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 04-07-2009 , 19:33   Re: Banning
Reply With Quote #6

Why not look at amx_admincmd.sma?
You have all the info you need there .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-08-2009 , 07:50   Re: Banning
Reply With Quote #7

Quote:
Originally Posted by ot_207 View Post
Why not look at admincmd.sma?
You have all the info you need there .
Corrected . This would be my advice too. That is the first place I look for anything that is done by the base amxmodx.
__________________
fysiks is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-08-2009 , 14:09   Re: Banning
Reply With Quote #8

ya just take a look and it's funny since your all actually wrong. To be 100% correct you must ;kick them after too ..
Styles is offline
Send a message via AIM to Styles
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-08-2009 , 15:02   Re: Banning
Reply With Quote #9

Quote:
Originally Posted by styles View Post
ya just take a look and it's funny since your all actually wrong. To be 100% correct you must ;kick them after too ..
I think no ones here wrong, though maybe u, since kicking has nothing to do with this.
Banning gives you bans, so you can't join the server anymore, and kick just throws you out of the game right up. There's no connection between kick or ban, at least nothing so kick should follow right after ban.
SnoW is offline
Send a message via MSN to SnoW
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-08-2009 , 17:57   Re: Banning
Reply With Quote #10

Quote:
Originally Posted by SnoW View Post
I think no ones here wrong, though maybe u, since kicking has nothing to do with this.
Banning gives you bans, so you can't join the server anymore, and kick just throws you out of the game right up. There's no connection between kick or ban, at least nothing so kick should follow right after ban.
If you only ban someone and don't kick them they will remain in the server until you kick them or they leave. At which point they will not be able to come back because of the ban.
__________________
fysiks 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