AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Team Ban (https://forums.alliedmods.net/showthread.php?t=149507)

Azelphur 02-07-2011 18:41

Team Ban
 
2 Attachment(s)
This is a simple plugin to allow you to ban a player from teams, This is handy for dealing with trolls who abuse team mechanics, such as shooting all the T's on jailbreak, or not planting the bomb on CT

It uses client preferences for storage (so MySQL/sqlite), It should work on any mod (in theory), reply here if it doesn't work on your mod.

Commands:
sm_teamban <name|#userid> <team> - Bans a player from <team>. Example: sm_teamban Azelphur ct
sm_teamunban <name|#userid> <team> - Unbans a player from <team>. Example: sm_teamunban Azelphur ct

Cvars:
sm_teamban_disable - Use this to disable the ability to ban people from certain teams, It's a bitmask. Each team has a number, for example on CS:S 1 is spectator, 2 is counter terrorist, 4 is terrorist, add the numbers together to disable. for example to disable banning from CT and T, 2+4 = 6, so sm_teamban_disable 6. or to disable spectator and terrorist, 1+4 = 5.

I wrote this as a paid job for XenoGamers and they have kindly asked me to post the plugin and share it with everyone :)


* Changelog *
0.3:
Fixed missing translations
Small optimization, switched to AddCommandListener()
0.2:
Fixed error messages in sm_teamban and sm_teamunban

namine 02-07-2011 19:00

Re: Team Ban
 
Finally, someone did this out of the goodness of their heart!

Azelphur 02-07-2011 19:01

Re: Team Ban
 
Quote:

Originally Posted by namine (Post 1409698)
Finally, someone did this out of the goodness of their heart!

except that I got paid to do it :P

SpazShot 02-07-2011 19:29

Re: Team Ban
 
Works great :)

Suggestions

• Chat notification that you banned a player.
- [SM] John banned Frank from the CT team!
• Menu option to ban a player from the team with a reason.
Team Ban
- Ban a player
-Unban a player
When opened you can choose the player name and then a reason such as freekilling or excessive team stacking.

• Logging

Azelphur 02-07-2011 19:32

Re: Team Ban
 
Quote:

Originally Posted by SpazShot (Post 1409717)
Works great :)

Suggestions

• Chat notification that you banned a player.
- [SM] John banned Frank from the CT team!

It already does this?

Quote:

Originally Posted by SpazShot (Post 1409717)
• Menu option to ban a player from the team with a reason.
Team Ban
- Ban a player
-Unban a player
When opened you can choose the player name and then a reason such as freekilling or excessive team stacking.

• Logging

It has a menu entry in /admin > player management, If I get some time when I'm very bored I might add logging and reasons, but this was a paid plugin and I don't use it on any of my servers so adding features isn't high on my priority list. Patches welcome.

SpazShot 02-07-2011 19:35

Re: Team Ban
 
It doesn't say anyone was banned from the ct team in chat. It only says they were unbanned.

Also when I type sm_teamban in console it interferes with the use of sm_ban.


] sm_teamban
[SM] Usage: sm_ban <#userid|name> <team>

Azelphur 02-07-2011 19:45

Re: Team Ban
 
Quote:

Originally Posted by SpazShot (Post 1409723)
It doesn't say anyone was banned from the ct team in chat. It only says they were unbanned.

Works for me (both console and menu), check for errors.
http://dl.dropbox.com/u/3832397/scre...x105_scrot.png


Quote:

Originally Posted by SpazShot (Post 1409723)
Also when I type sm_teamban in console it interferes with the use of sm_ban.


] sm_teamban
[SM] Usage: sm_ban <#userid|name> <team>


Cosmetic issue, it doesn't interfere, I just copied the error message from sm_ban and forgot to change it xD, fixed now.

databomb 02-07-2011 23:37

Re: Team Ban
 
Azelphur, good job and thank you for posting yours. I believe there's more than 3 different SM team bans plugins now and this is the first that's become open source, congrats!

Do you know if xG had any errors with this? I didn't see a call to AreClientCookiesCached but maybe this isn't needed on a really fast server by the time the first respawn hits.

Azelphur 02-08-2011 13:46

Re: Team Ban
 
Quote:

Originally Posted by databomb (Post 1409829)
Azelphur, good job and thank you for posting yours. I believe there's more than 3 different SM team bans plugins now and this is the first that's become open source, congrats!

Do you know if xG had any errors with this? I didn't see a call to AreClientCookiesCached but maybe this isn't needed on a really fast server by the time the first respawn hits.

I wrote this as a paid job and they use it, so I assume if they had any issues they'd shout at me :p

You are correct, there are no calls to AreClientCookiesCached, If your MySQL server doesn't respond between OnClientAuthorized and join team (which is a good 5-10 seconds), your hard drive is probably failing or your MySQL server is on dialup in outer mongolia :P

SpazShot 02-10-2011 09:09

Re: Team Ban
 
Code:

L 02/09/2011 - 19:31:32: [SM] Plugin encountered error 4: Invalid parameter or parameter type
L 02/09/2011 - 19:31:32: [SM] Native "ReplyToCommand" reported: Language phrase "No matching client" not found
L 02/09/2011 - 19:31:32: [SM] Displaying call stack trace for plugin "teamban.smx":
L 02/09/2011 - 19:31:32: [SM]  [0]  Line 103, /groups/sourcemod/compiler-1.3/include/commandfilters.inc::ReplyToTargetError()
L 02/09/2011 - 19:31:32: [SM]  [1]  Line 198, /groups/sourcemod/compiler-1.3/include/helpers.inc::FindTarget()
L 02/09/2011 - 19:31:32: [SM]  [2]  Line 312, /home/groups/alliedmodders/forums/files/8/0/1/8/0/81936.attach::Command_Teamban()
L 02/09/2011 - 19:38:55: Error log file session closed.

Is this a problem?


All times are GMT -4. The time now is 00:35.

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