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

[REQ]removing cafe accounts.....


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siosios
SourceMod Donor
Join Date: Jan 2008
Old 03-31-2008 , 10:39   [REQ]removing cafe accounts.....
Reply With Quote #1

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

Last edited by siosios; 03-31-2008 at 12:12.
siosios is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 12:16   Re: [REQ]removing cafe accounts.....
Reply With Quote #2

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
__________________
V0gelz is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 03-31-2008 , 12:21   Re: [REQ]removing cafe accounts.....
Reply With Quote #3

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
siosios is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 13:25   Re: [REQ]removing cafe accounts.....
Reply With Quote #4

Are you sure these are steamid's that only café accounts use?
__________________
V0gelz is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 03-31-2008 , 13:38   Re: [REQ]removing cafe accounts.....
Reply With Quote #5

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
siosios is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 14:10   Re: [REQ]removing cafe accounts.....
Reply With Quote #6

You can allways IP ban him :/
__________________
V0gelz is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 03-31-2008 , 14:11   Re: [REQ]removing cafe accounts.....
Reply With Quote #7

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......
siosios is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 14:23   Re: [REQ]removing cafe accounts.....
Reply With Quote #8

To bad mac address isn't allowed ;x
__________________
V0gelz is offline
siosios
SourceMod Donor
Join Date: Jan 2008
Old 03-31-2008 , 14:29   Re: [REQ]removing cafe accounts.....
Reply With Quote #9

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
siosios is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 03-31-2008 , 14:57   Re: [REQ]removing cafe accounts.....
Reply With Quote #10

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.
__________________
V0gelz is offline
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 20:24.


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