AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dynamic ban (https://forums.alliedmods.net/showthread.php?t=89890)

Nyuszy 04-11-2009 16:56

dynamic ban
 
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

Owyn 04-11-2009 17:01

Re: dynamic ban
 
just ban by steamid this will ban player with dynamic ip

Bugsy 04-11-2009 17:06

Re: dynamic ban
 
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.

Nyuszy 04-11-2009 17:25

Re: dynamic ban
 
ok but i want to ban they config, not steam id... can anybody help me?

Nextra 04-11-2009 17:27

Re: dynamic ban
 
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.

Bugsy 04-11-2009 17:45

Re: dynamic ban
 
What does "ban they config" mean?

Nyuszy 04-11-2009 17:46

Re: dynamic ban
 
ok, but the baned dont disconnect...

Nextra 04-11-2009 17:49

Re: dynamic ban
 
Quote:

Originally Posted by Bugsy (Post 803262)
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 (Post 803264)
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.

YamiKaitou 04-11-2009 22:43

Re: dynamic ban
 
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?

tomba2k 12-20-2009 04:59

Re: dynamic ban
 
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:)


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

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