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

dynamic ban


Post New Thread Reply   
 
Thread Tools Display Modes
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
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-11-2009 , 17:01   Re: dynamic ban
Reply With Quote #2

just ban by steamid this will ban player with dynamic ip
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2009 , 17:06   Re: dynamic ban
Reply With Quote #3

Agreed, though banning by steam id will not 'ban people with dynamic ip.' It will ban people regardless of the type of IP they have.

How can you determine if the player has static or dynamic IP? Better off just using the steam id. It is much easier (and free) for people to change their IP vs. getting a new steam id.
__________________
Bugsy is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-11-2009 , 17:25   Re: dynamic ban
Reply With Quote #4

ok but i want to ban they config, not steam id... can anybody help me?
Nyuszy is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-11-2009 , 17:27   Re: dynamic ban
Reply With Quote #5

Agreeing to the above posts but your problem is that you mix up the "bankey" string multiple times. You should not name 3 different vars bankey.
__________________
In Flames we trust!
Nextra is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2009 , 17:45   Re: dynamic ban
Reply With Quote #6

What does "ban they config" mean?
__________________
Bugsy is offline
Nyuszy
Senior Member
Join Date: Apr 2009
Old 04-11-2009 , 17:46   Re: dynamic ban
Reply With Quote #7

ok, but the baned dont disconnect...
Nyuszy is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-11-2009 , 17:49   Re: dynamic ban
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
What does "ban they config" mean?
He will be setting a custom info keyvalue by "setinfo" clcmd which he then retrieves on reconnect. Not a good solution but it should work as long as the client does not restart his game.

Quote:
Originally Posted by Nyuszy View Post
ok, but the baned dont disconnect...
PHP Code:
if(strlen(bankey) > 0){
    
server_cmd("amx_kick #%d ^"Banned!^""get_user_userid(id))
    
server_exec()
    return  
PLUGIN_HANDLED

Think that should fix it.
__________________
In Flames we trust!
Nextra is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-11-2009 , 22:43   Re: dynamic ban
Reply With Quote #9

I have two questions for you (you may answer me via PM if you wish). Why do you want to ban someone this way and are you related to the user VSA?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
tomba2k
Junior Member
Join Date: Jan 2008
Location: Zagreb, Croatia
Old 12-20-2009 , 04:59   Re: dynamic ban
Reply With Quote #10

Why musted he be related to VSA?
Do you now how many people want to have plugin like this?
Also, what if he has for example lan server on wlan, and get cheaters on his server?
In Bosnia and Herzegovina, there is many ISP's that have wireless broadband PPPoE connection.
And what if he don't know how to update his steam server, so he can't get VAC running on his server?
Or have port problems on his server?
So anyone with cracked or emulated or semi-steam can connect with wh to his server?
Don't persume that he has internet non-steam server, try to find if he has by asking him indirectly.
If AMX mod X is giving people option to ban via IP, until you are positive that guy is asking question for online non-steam server, don't ignore him nor say him "no-support here".
there is amx_bancfg plugin from Alka, but i'm note sure am i allowed to post link here.

there r russian non steam servers (abbys it's the name of servers i think) that even have plugin like this integrated with amxbans.
excelent work, to bad it's useful for non steam servers mostly
__________________
...
tomba2k is offline
Send a message via MSN to tomba2k Send a message via Skype™ to tomba2k
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 08:40.


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