AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [REQ]removing cafe accounts..... (https://forums.alliedmods.net/showthread.php?t=69256)

siosios 03-31-2008 10:39

[REQ]removing cafe accounts.....
 
i was wondering if anyone could port the code below, that i found for amx, over too sourcemod. i am having hell with hackers on cafe accounts and would just like to get rid of all cafe steam id's as i come across them by editing the plugins code and adding the steam id's or parts of them. preferebly rather then a kick i would like to ban the offending steam id upon a match to sourcebans.

Code:

#include <amxmodx>
 
public plugin_init()
{
register_plugin("Mass SteamID Ban", "1.0", "Lee");
}
 
public client_authorized(id)
{
new userSteamID[20];
//place the full SteamID inside userSteamID
get_user_authid(id, userSteamID, 19);
//remove 'STEAM_0:x:'
format(userSteamID, 19, userSteamID[10]);
 
//if the SteamID is 8 digits long and the first 3 characters equal "157" or "156"
if(strlen(userSteamID) == 8 && (equal(userSteamID, "157", 3) || equal(userSteamID, "156", 3)))
{
//kick them
server_cmd("kick #%i", get_user_userid(id));
}
}

thanks for anyones input into this
siosios

V0gelz 03-31-2008 12:16

Re: [REQ]removing cafe accounts.....
 
Code:

#include <sourcemod>
#define PLUGIN_VERSION "0.1"

public Plugin:myinfo =
{
        name = "Anti Café",
        author = "V0gelz",
        description = "Anti Café",
        version = PLUGIN_VERSION,
        url = ""
};

public OnPluginStart()
{

}

public OnClientPostAdminCheck(client)
{

        decl String:authid[64];
        GetClientAuthString(client, authid, 63);

        new name[32];
        GetClientName(client,name,31);

        Format(authid, 19, authid[10]);


        //if the SteamID is 8 digits long and the first 3 characters equal "157" or "156"
        if(strlen(authid) == 8 && (StrEqual(authid, "157", 3) || StrEqual(authid, "156", 3)))
        {
                //kick them
                ServerCommand("kick #%i", GetClientUserId(client));
                PrintToServer("Player: %s  with steamid: %d has been kicked",name,authid);
        }

        return Plugin_Continue;
}

this should work.

gl

siosios 03-31-2008 12:21

Re: [REQ]removing cafe accounts.....
 
thank you very much for the reply in such a short period of time. im sure this will come in handy for others as well

sio

V0gelz 03-31-2008 13:25

Re: [REQ]removing cafe accounts.....
 
Are you sure these are steamid's that only café accounts use?

siosios 03-31-2008 13:38

Re: [REQ]removing cafe accounts.....
 
the ones in the code you posted i replaced with the ones i see most commonly used when hacking in my servers. ill post a few of the steam id's so you can see

changed this to match the digit count for the steam id and added the first 3 digits of the offending range:
Code:

if(strlen(authid) == 7 && (StrEqual(authid, "775", 3) || StrEqual(authid, "777", 3)))
this is all the same guy:
ip of 74.232.235.39

STEAM_0:1:7753332
STEAM_0:1:7753384
STEAM_0:1:7753091
STEAM_0:1:7752449
STEAM_0:1:7751805
STEAM_0:0:7773705
STEAM_0:0:7773558
STEAM_0:0:7773468
STEAM_0:0:7773416
STEAM_0:0:7772095

and there is about 20 - 25 more just from this one guys ip we ban he comes right back in hence the need for the plugin (this happens daily but with a different guy or ip at least)

thanks
siosios

V0gelz 03-31-2008 14:10

Re: [REQ]removing cafe accounts.....
 
You can allways IP ban him :/

siosios 03-31-2008 14:11

Re: [REQ]removing cafe accounts.....
 
yea but with that thought in mind how hard is it to unplug your router/cable modem and get a fresh ip and go at it again......

V0gelz 03-31-2008 14:23

Re: [REQ]removing cafe accounts.....
 
To bad mac address isn't allowed ;x

siosios 03-31-2008 14:29

Re: [REQ]removing cafe accounts.....
 
the thread i found the amx code in mentioned that too.

btw i have already run into a regular player that got removed by it.....

how hard would it be to code in a whitelist so that i could whitelist that steam id?

again i thank you for the help as i can only modify code that i understand and i dont get c++

sio

V0gelz 03-31-2008 14:57

Re: [REQ]removing cafe accounts.....
 
Code:

#include <sourcemod>
#define PLUGIN_VERSION "0.1"

public Plugin:myinfo =
{
        name = "Anti Café",
        author = "V0gelz",
        description = "Anti Café",
        version = PLUGIN_VERSION,
        url = ""
};

public OnClientPostAdminCheck(client)
{
        decl String:authid[64];
        GetClientAuthString(client, authid, 63);

        new name[32];
        GetClientName(client,name,31);

        Format(authid, 19, authid[10]);

        //if the SteamID is 7 digits long and the first 3 characters equal "775" or "777"
        if(strlen(authid) == 7 && (StrEqual(authid, "775", 3) || StrEqual(authid, "777", 3)))
        {
                // Here you can add or remove the cafe account steamids you allow on the server.
                if( StrEqual(authid, "12345678") || StrEqual(authid, "12345678") )
                {
                        PrintToServer("Player: %s  with steamid: %d  with café ID is been allowed to play here.",name,authid);
                }
                else
                {
                        ServerCommand("kick #%i", GetClientUserId(client));
                        PrintToServer("Player: %s  with steamid: %d  with café ID has been kicked because of cafe account.",name,authid);
                }
        }

        return Plugin_Continue;
}

This should work.. again.


All times are GMT -4. The time now is 13:53.

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