Raised This Month: $ Target: $400
 0% 

dynamic ban


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-11-2009 , 16:56   dynamic ban
Reply With Quote #1

i try to make a plugin that ban plyers with dynamic ip, and i can compile it but it wont work.
Code:
#include <amxmodx>
#include <amxmisc>

new const bankey[] = "_sow"

public plugin_init()
{
    register_plugin("Dynamic Ban", "1.0", "Nyuszy")

    register_concmd("amx_dynban", "cmdBan", ADMIN_BAN, "<target>")
}

public cmdBan(id, level, cid)
{
    if (!cmd_access(id, level, cid, 3))
        return PLUGIN_HANDLED

    new target[32]
    
    read_argv(1, target, 31)
    
    new player = cmd_target(id, target)
    
    if (!player)
        return PLUGIN_HANDLED

    new name[32]
    
    get_user_name(player, name, 31)
    
    server_cmd("amx_ban %s ^"Banned!^"", name)
    
    client_cmd(player, "setinfo %s 1", bankey)
    
    client_print(0, print_chat, "[AMXX] ADMIN ban %s", name)

    return PLUGIN_HANDLED
}

public client_connect(id)
{
    new bankey[32]
    get_user_info(id, "bankey", bankey, 31)

    if(strlen(bankey) > 0)
    {
        server_cmd("amx_kick %d ^"Banned!^"", get_user_userid(id))
        return PLUGIN_HANDLED
    }
    return PLUGIN_HANDLED
}
what is wrong? pls help
Nyuszy 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 02:14.


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