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

Deny connections based off steam groups


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xomp
BANNED
Join Date: Jul 2008
Old 05-30-2012 , 11:35   Deny connections based off steam groups
Reply With Quote #1

Since I've had no real success in the SteamTools section getting this working I figured I'd present it here for others to take a look.

So I have an old plugin here written by asherkin that I used long ago to keep certain troll groups off my servers. It no longer appears to be working now and I was hoping maybe someone could take a peak and maybe submit a fix for it. It's a great way to keep the general troll out of your server and think it would come in handy to a bunch of folks. To look up "groupAccountID" simply paste the steam group link HERE.

Code:
#pragma semicolon 1

#include <sourcemod>

#define AUTOLOAD_EXTENSIONS
#define REQUIRE_EXTENSIONS
#include <steamtools>

#define PLUGIN_VERSION "0.1.0"

public Plugin:myinfo = {
	name        = "Steam Group Kicker",
	author      = "Asher Baker (asherkin)",
	description = "Filters Trolls from the server.",
	version     = PLUGIN_VERSION,
	url         = "http://limetech.org/"
};

new Handle:enabled = INVALID_HANDLE;
new Handle:immunity = INVALID_HANDLE;

public OnPluginStart()
{
	LoadTranslations("common.phrases");
	
	enabled = CreateConVar("sm_fpblock_enabled", "1", "", FCVAR_NONE, true, 0.0, true, 1.0);
	immunity = CreateConVar("sm_fpblock_immunity", "1", "", FCVAR_NONE, true, 0.0, true, 1.0);
}

public OnClientAuthorized(client, const String:auth[])
{
	if (GetConVarBool(enabled) || (GetConVarBool(immunity) && GetUserAdmin(client) != INVALID_ADMIN_ID))
	{
		return;
	}
	
	if (!Steam_RequestGroupStatus(client, 2483875))
	{
		WarnAdmins(client);
	}
}

public WarnAdmins(client)
{
	for (new i; i <= MaxClients; i++)
	{
		if (!IsClientInGame(i) || !GetAdminFlag(GetUserAdmin(client), Admin_Kick))
		{
			continue;
		}
		
		PrintToChat(i, "[SM] Player %N bypassed Group check. Disconnected from Steam?", client);
	}
}

public Steam_GroupStatusResult(client, groupAccountID, bool:groupMember, bool:groupOfficer)
{
	if (groupAccountID == 2483875 && groupMember)
	{
		KickClientEx(client, "%s", "This Group Not Allowed");
	}
	
}
xomp is offline
Send a message via Skype™ to xomp
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 05-30-2012 , 12:24   Re: Deny connections based off steam groups
Reply With Quote #2

Quote:
Originally Posted by xomp View Post
Code:
KickClientEx(client, "%s", "This Group Not Allowed");
Why KickClientEx?

Also,

Code:
"%s", "This Group Not Allowed"
is just silly.
__________________

Last edited by Dr. McKay; 05-30-2012 at 12:24.
Dr. McKay is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-30-2012 , 12:36   Re: Deny connections based off steam groups
Reply With Quote #3

Quote:
Originally Posted by Dr. McKay View Post
Why KickClientEx?
Carry over from the plugin it was based on.

Quote:
Originally Posted by Dr. McKay View Post
Code:
"%s", "This Group Not Allowed"
is just silly.
Left over from when it allowed user-specified kick messages.

Neither related to the problem at hand.
__________________
asherkin is offline
xomp
BANNED
Join Date: Jul 2008
Old 05-31-2012 , 22:09   Re: Deny connections based off steam groups
Reply With Quote #4

xomp is offline
Send a message via Skype™ to xomp
Reply


Thread Tools
Display Modes

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 05:16.


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