AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Banning player by server_cmd (https://forums.alliedmods.net/showthread.php?t=89566)

BOYSplayCS 04-07-2009 19:08

Banning player by server_cmd
 
How do you ban a player permanently by server_cmd?

like, what would be the code?

alan_el_more 04-07-2009 19:26

Re: Banning
 
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 :|

ot_207 04-07-2009 19:33

Re: Banning
 
Why not look at amx_admincmd.sma?
You have all the info you need there :):P.

ehha 04-08-2009 07:01

Re: Banning
 
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)

SnoW 04-08-2009 07:43

Re: Banning
 
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.
*/ 


ot_207 04-08-2009 07:45

Re: Banning
 
Quote:

Originally Posted by SnoW (Post 800617)
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 ....

fysiks 04-08-2009 07:50

Re: Banning
 
Quote:

Originally Posted by ot_207 (Post 800314)
Why not look at admincmd.sma?
You have all the info you need there :):P.

Corrected :). This would be my advice too. That is the first place I look for anything that is done by the base amxmodx.

Styles 04-08-2009 14:09

Re: Banning
 
ya just take a look and it's funny since your all actually wrong. To be 100% correct you must ;kick them after too ..

YamiKaitou 04-08-2009 14:38

Re: Banning
 
As per the Global Forum Rules, you need to have a descriptive topic title. If you wish for this topic to stay open, please correct the topic title before you post again.

SnoW 04-08-2009 15:02

Re: Banning
 
Quote:

Originally Posted by styles (Post 800872)
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.


All times are GMT -4. The time now is 02:22.

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