Monthly Target: $400 Donations: $9
 2% 

Simple TK Manager v1.0d Updated 5/27/2011


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Lebson506th
Veteran Member
Join Date: Jul 2008
Plugin ID:
517
Plugin Version:
1.0d
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    135 
    Plugin Description:
    Simple team killing (TK) solution
    Old 08-22-2008 , 22:43   Simple TK Manager v1.0d Updated 5/27/2011
    Reply With Quote #1

    Simple TK Manager
    By Lebson506th

    Description

    This plugin is just a simple solution to an annoying problem: Team killers. All this plugin does is count how many times a person TKs and is not forgiven for the TK. When the TK limit is reached, it kicks or bans the player for a set amount of time. There is also a reflect damage ability where it will reflect all team damage back onto the attacker.

    Note: Reflect damage does not block headshots and/or shots that kill the victim instantly. In these cases both the victim and the attacker will die.


    Known Issues
    • Counter-Strike: Source is acting weird with this plugin resulting in reflect damage not working.
    Cvars
    Code:
    sm_stk_enabled (default: 1) - Enables(1) or disables(0) the plugin.
    
    sm_stk_reflect (default: 1) - Enables(1) or disables(0) reflecting damage back onto a team attacker.
    
    sm_stk_limit (default: 5) - Sets the number of TKs a player has to get before they are automatically kicked.
    
    sm_stk_forgivemessage (default: 1) - Changes who the forgiven/not forgiven messages can be seen by.
    • 0 - Nobody
    • 1 - Everyone
    • 2 - People involved
    • 3 - Admin and people involved
    • 4 - Admins only
    sm_stk_countmessage (default: 2) - Changes who the TK count message can be seen by.
    • 0 - Nobody
    • 1 - Everyone
    • 2 - People involved
    • 3 - Admin and people involved
    • 4 - Admins only
    sm_stk_punishmessage (default: 1) - Changes who the punishment messages can be seen by.
    • 0 - Nobody
    • 1 - Everyone
    • 2 - People involved
    • 3 - Admin and people involved
    • 4 - Admins only
    sm_stk_kickmessage (default: 1) - Show a message to everyone(1) or admin only (2) when a player is kicked for TKing. 0 to disable sm_stk_protecttime (default: 10) - Automatically slay any team attacker in spawn during this amount of seconds after spawn sm_stk_immunity (default: 7) - Manages admin immunity mode.
    • 0 - Disabled, no admin immunity.
    • 1 - Admin immune to reflect damage and spawn slaying.
    • 2 - Admin immune to being kicked for TKing.
    • 3 - Options 1 and 2
    • 4 - Admin immune to TK punishments
    • 5 - Options 1 and 4
    • 6 - Options 2 and 4
    • 7 - Options 1, 2 and 4
    sm_stk_punishmode (default: 1) - Manages the TKer punishment modes on top of kick.
    • 0 - No additional punishment.
    • 1 - Let the victim choose.
    • 2 - Use sm_stk_punishment
    sm_stk_punishment (default: 1) - Manages the TKer punishment if sm_stk_punishmode = 2.
    • 0 - Warn
    • 1 - Slay
    • 2 - Burn
    • 3 - Freeze
    • 4 - Beacon
    • 5 - Freeze Bomb
    • 6 - Fire Bomb
    • 7 - Time Bomb
    • 8 - Drug
    • 9 - Remove % Cash
    • 10 - Slap
    sm_stk_allowslay (default: 1) - If sm_stk_punishmode = 1, allow slaying the attacker as a punishment. sm_stk_allowfreeze (default: 1) - If sm_stk_punishmode = 1, allow freezing the attacker as a punishment. sm_stk_allowbeacon (default: 1) - If sm_stk_punishmode = 1, allow putting a beacon on the attacker as a punishment. sm_stk_allowfreezebomb (defualt: 1) - If sm_stk_punishmode = 1, allow putting a freezebomb on the attacker as a punishment. sm_stk_allowfirebomb (deault: 1) - If sm_stk_punishmode = 1, allow putting a firebomb on the attacker as a punishment. sm_stk_allowtimebomb (default: 1) - If sm_stk_punishmode = 1, allow putting a timebomb on the attacker as a punishment. sm_stk_drugtime (default: 10) - If sm_stk_punishmode = 1, set the time a TKer is drugged as a punishment. 0.0 to disable. sm_stk_burntime (default: 10) - If sm_stk_punishmode = 1, set the time a TKer is burnt as a punishment. 0.0 to disable. sm_stk_slapdamage (default: 5) - If sm_stk_punishmode = 1, slap the TKer for this amount of damage as a punishment. 0 to disable. sm_stk_bantime (default: -1) - Manages how long a player is banned for once they reach the TK limit. (Less than 0 is a kick) sm_stk_removecash (default: 25) - Sets the percentage of cash the victim can remove from the attacker. 0 to disable. Only for CSS. sm_stk_logging (default: 2) - Sets the logging mode. 0 = No logging, 1 = Verbose logging, 2 = Only log TK Count and "Kicked" messages, 3 = Only log "Kicked" messages
    Installation Instructions
    1. Copy simpletk.smx to addons/sourcemod/plugins
    2. Copy simpletk.phrases.txt to addons/sourcemod/translations
    3. Using RCON, do "sm plugins load simpletk"
    4. It will create it's own config file in moddir/cfg/sourcemod
    Special Thanks To
    • Cain for suggesting this in the first place and being my primary tester.
    • Greyscale for trying to help the reflect portion work better.
    • FeuerSturm for helping me fix a couple initial bugs and for giving me a better way to slay in spawn.
    • Sgt-Mess for testing and reporting bugs, suggesting the punishments, punishment modes, for helping to test it all during the 0.7Beta-0.7Beta4 stage, for testing in insurgency exclusively, and for pointing out a documentation error on my part.
    • The members of the [506th PIR] that were my guinea pigs while I tested out this plugin.
    • The members of {CLR} for massive testing and bug squashing.
    • tObIwAnKeNoBi for translating the plugin into german.
    • WhiteWolf for helping me track down some memory issues.
    • doa for suggesting the spawn protection.
    • PStar for hungarian translation and pointing out a bug in my new translations.
    • BAILOPAN for helping me attempt to fix slay not working in insurgency.
    • Liam for helping me fix the timer errors with UnDrug.
    • wapo20 for translating the plugin into Spanish.
    • djloeffler007 for fixing some errors in the German translation and translating the new phrases.
    • smfd for suggesting SourceBans integration.
    • DJ Tsunami for helping me fix SourceBans integration.
    • vintage.59 for translating the plugin into French
    • 5l4v45 for translating the plugin into Polish
    • monkie for showing me a small error related to clients, reminding me to change the forum compiler to 1.1, and translating the plugin into Simplified Chinese.
    • klink for translating the plugin into Russian.
    • Raptor10 for translating the plugin into Italian.
    • deadbwoy for pointing out a few minor issues and posting fixes for them.
    • WaYne82 for reporting the specifics of an admin immunity bug and testing the fix for it.
    Current Languages
    • English
    • German
    • Hungarian
    • Spanish
    • French
    • Polish
    • Simplified Chinese
    • Russian
    • Italian
    ToDo
    • Get translated
    • Looking for suggestions
    Change Log
    Code:
    5/27/2011 - v1.0d
    
    • Fixed admins not being able to be punished even when sm_stk_immunity was set to 0
    • Fixed a rare error when sm_stk_punishment was set to something invalid.
    5/26/2011 - v1.0c
    • Fixed a small error in the French translations
    • Fixed a small error in the chat printing.
    4/12/2009 - v1.0b
    • Added automatic changing of "mp_spawnprotecttime" to 0 on plugin start if it is available.
    • Removed supper for Resistance and Liberation because it doesn't report events required to make this plugin work.
    3/1/2009 - v1.0a
    • Fixed a small error related to invalid clients.
    • Reverted some small code changes to prevent more errors like this.
    2/28/2009 - v1.0
    • Added logging into its own file. The file is located in sourcemod/logs/stk_log_mmddyy.log.
    • Added logging of every message so you know the progress of people TKing rather than just when they are kicked.
    • Added sm_stk_loggin to manage the logging behavior.
    • Changed code to use MaxClients variable introduced in SourceMod 1.1
    • Changed code to clean it up a little.
    • Removed redundant check for insurgency support.
    10/5/2008 - v0.9
    • Thanks to FeuerSturm, the in-spawn slaying now works a lot better and I was able to drop my ridiculous work around.
    • Changed some code around to maybe reduce the possibility of the auto-forgive bug more.
    9/29/2008 - v0.8e
    • Fixed SourceBans integration. For real this time =)
    • Removed the need for a seperate include file. Now compiles on the forum and the web compiler.
    9/29/2008 - v0.8d
    • Fixed SourceBans integration.
    9/27/2008 - v0.8c
    • Changed version CVAR to not get added to the auto-created config.
    • Added automatic MySQL Banning and SourceBans integration if banning is enabled (sm_stk_bantime >= 0)
    9/10/2008 - v0.8b
    • Shifted around some code to reduce the probability of the auto-forgive bug, if not eliminate it.
    • Removed some redundant and useless code.
    • Fixed a possible bug where a client was being queried even after they had been kicked.
    9/9/2008 - v0.8a
    • Fixed a bug where forgiving a player meant that you forgived everyone until you rejoined.
    • Fixed sm_stk_drugtime and sm_stk_burntime defaulting to 1 instead of 10
    • Fixed the "warn" punishment not displaying according to the punishment message CVAR.
    9/8/2008 - v0.8
    • Changed the plugin to auto-generate a config file in cfg/sourcemod.
    • Added slap, firebomb, freezebomb, timebomb, and removal of money as punishments.
    • Added CVARs to enable and disable the new punishments.
    • Changed translations to reflect the new punishments.
    • Changed sm_stk_punishment to reflect the new punishments.
    9/3/2008 - v0.7f
    • Fixed passed handler error for the undrug function.
    • Fixed a future error where the script would try to punish a player after the map changed and end up punishing the wrong person (or throwing an error).
    9/2/2008 - v0.7e
    • Small tweak to fix insurgency error messages. (Other mods don't need to update)
    9/2/2008 - v0.7d
    • Fixed punishment menu not showing up.
    • Fixed TK immunity when sm_stk_immunity was set to 0
    • Fixed wrong punishments when not all were enabled
    9/2/2008 - v0.7c
    • Changed something I was testing that was probably causing crashes.
    9/1/2008 - v0.7b
    • Fixed slay not working in insurgency.
    8/31/2008 - v0.7a
    • Fixed a bug where the client was less than 0.
    • Fixed an array out of bounds error.
    • Fixed some bugs where I was trying to reset a variable of a client that was no longer connected.
    • Added more checks to hopefully fix the auto-forgive bug.
    8/30/2008 - v0.7
    • Everything from v0.7Beta to v0.7Beta4
    • Added some variable checks to prevent future errors
    • Added some attacker/client checks to hopefully eliminate the auto-forgive bug.
    8/29/2008 - v0.7Beta4
    • Fixed CVARs sm_stk_burntime and sm_stk_drugtime
    • Added sm_stk_bantime that manages how long a player is banned for once they reach the TK limit. (Less than 0 is a kick)
    8/29/2008 - v0.7Beta3
    • Changed sm_stk_allowburn to sm_stk_burntime to change the length of the burn punishment. 0.0 to disable.
    • Changed sm_stk_allowdrug to sm_stk_drugtime to change the length of the drug punishment. 0.0 to disable.
    • Fixed a drugged player not undrugging.
    • Fixed a punishment not working if the attacker was dead from reflected damage. (Punishment will happen on next spawn. Possible delay of up to 5 seconds after it).
    8/29/2008 - v0.7Beta2
    • Fixed the sm_stk_punishmode 2 not working.
    • Fixed displaying the punishment menu to the wrong client. (Letting the attacker punish the victim is bad)
    • Fixed Burn not working.
    • Fixed Freeze not working.
    • Fixed admins not being immune to TK punishments when sm_stk_immunity was set to protect them.
    8/29/2008 - v0.7Beta
    • Fixed a bug where admin were not immune to spawn slaying if they killed the victim.
    • Added two punishment modes. 1, the victim gets to choose a punishment from a menu. 2, the admin defines a pre-set punishment, 0 disables.
    • Added sm_stk_punishmode, sm_stk_punishment, sm_stk_allowslay, sm_stk_allowburn, sm_stkallowfreeze, sm_stk_allowbeacon, and sm_stk_allowdrug. See documentation.
    • Changed sm_stk_immunity to account for the new punishments. Now defaults to 7, as well as multiple additions. See documentation.
    8/27/2008 - v0.6
    • Added sm_stk_immunity cvar to change admin immunity.
      • 0 - Disabled, no admin immunity.
      • 1 - Admin immune to reflect damage and spawn slaying.
      • 2 - Admin immune to being kicked for TKing.
      • 3 - Both options 1 and 2
    • Changed translations to work with the new command. (Update both files)
    8/25/2008 - v0.5a
    • Changed the auto-forgive to be more consistent.
    • Fixed a bug where slaying in spawn wouldn't work if reflect damage was turned off sometimes.
    • Changed display to show when a player was slayed for too much TA vs. TAing in spawn. (Update translations)
    8/24/2008 - v0.5
    • Changed how the message management was done to clean it up a bit.
    • Fixed a bug where an invalid client was being referenced.
    • Changed the kick message to show the kicked player's Steam ID (update translations)
    • Added logging to show who is kicked for TKing.
    • Fixed a bug where the player would sometimes not be killed after a TK with reflect damage on.
    • Changed the in spawn killing routine to make sure the person dies. (No more stuck in the skybox)
    • Added German translations thanks to tObIwAnKeNoBi
    • Removed some unneeded code.
    • Added the ability to slay spawn attackers for a certain amount of time after the victim spawns.
    • Added sm_stk_protecttime to manage this function.
    • If a player still has a forgive menu open, all TKs done to that player are now autoforgiven.
    • Removed the "exit" button from the forgive menu. It is a yes or no question, make a choice.
    • Fixed the memory leaks and crashes. (Yay)
    8/23/2008 - v0.4
    • Fixed TK count not being reset after a player is kicked.
    • Fixed a bug where TKers in spawn would not die with reflect damage enabled. (If players are alive after being "suicided" their health is set to 1 and then they are dropped a large distance to their death)
    • Changed the way i did reflect damage (it was based on the first version of Reflect Team Damage instead of the second)
    • Changed "sm_stk_messagetype" to "sm_stk_forgivemessage"
    • Added a message that informs the TKer of how many TKs they have and how many they need until they are kicked.
    • Added "sm_stk_countmessage" to manage who sees this message.
    • Added "sm_stk_kickmessage" to manage who sees the message when a player is kicked for TKing.
    • Fixed a bug where the TK manager would not work if reflect was off.
    8/23/2008 - v0.3
    • Fixed some minor warning.
    • Fixed menu not showing up properly.
    • Fixed bugs where client was <= 0
    8/22/2008 - v0.2
    • Added the ability to forgive players who TKed from a menu.
    • Added a CVAR to change the who the forgive/did not forgive messages are displayed to.
    8/22/2008 - v0.1
    • Initial Release
    Attached Files
    File Type: txt simpletk.phrases.txt (17.6 KB, 3573 views)
    File Type: sp Get Plugin or Get Source (simpletk.sp - 5734 views - 39.2 KB)
    __________________
    My Plugins
    Spray Tracer by Nican, maintained by me
    Simple TK Manager
    DoD:S Admin Weapons

    Links
    Resistance and Liberation (A HL2 Multiplayer Modification)

    Last edited by Lebson506th; 05-27-2011 at 13:36. Reason: 1.0d
    Lebson506th is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 08-22-2008 , 23:06   Re: Simple TK Manager v0.1 Updated 8/22/2008
    Reply With Quote #2

    I will try on insurgency server. Can you add support in the future for client's to decide to forgive or not forgive attacker, or team killer.
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    Lebson506th
    Veteran Member
    Join Date: Jul 2008
    Old 08-22-2008 , 23:08   Re: Simple TK Manager v0.1 Updated 8/22/2008
    Reply With Quote #3

    Quote:
    Originally Posted by Sgt-Mess View Post
    I will try on insurgency server. Can you add support in the future for client's to decide to forgive or not forgive attacker, or team killer.
    It doesn't count team attacks right now, but i can add the forgive thing.
    __________________
    My Plugins
    Spray Tracer by Nican, maintained by me
    Simple TK Manager
    DoD:S Admin Weapons

    Links
    Resistance and Liberation (A HL2 Multiplayer Modification)
    Lebson506th is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 08-22-2008 , 23:38   Re: Simple TK Manager v0.1 Updated 8/22/2008
    Reply With Quote #4

    Quote:
    Originally Posted by Lebson506th View Post
    It doesn't count team attacks right now, but i can add the forgive thing.
    Cool I'll let you know how it works out on our insurgency server.

    EDIT: it says failed to compile.
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    Lebson506th
    Veteran Member
    Join Date: Jul 2008
    Old 08-22-2008 , 23:46   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #5

    Yea, i know. That's why i removed it.

    Edit: Fixed.

    I'm getting a bunch of tag mismatch warnings when i'm getting one of my convars as an int. I don't know why...

    Anyway... it compiles so try it out.
    __________________
    My Plugins
    Spray Tracer by Nican, maintained by me
    Simple TK Manager
    DoD:S Admin Weapons

    Links
    Resistance and Liberation (A HL2 Multiplayer Modification)

    Last edited by Lebson506th; 08-22-2008 at 23:51.
    Lebson506th is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 08-23-2008 , 00:42   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #6

    Ok it seems to only work once when I team killed someone this is what it said:

    *** [STK] FPSBanana Dingoland Insurgency did not forgive FPSBanana Dingoland Insurgency for tking.

    Thats the name of our server.


    The person I team killed said a menu came up and it said Forgive and blank which was Not Forgive.

    This is what I got from a error log.

    L 08/22/2008 - 12:20:04: Error log file session closed.
    L 08/22/2008 - 22:294: SourceMod error session started
    L 08/22/2008 - 22:294: Info (map "ins_karkar") (file "errors_20080822.log")
    L 08/22/2008 - 22:295: [SM] Native "GetClientName" reported: Client index -3 is invalid
    L 08/22/2008 - 22:295: [SM] Displaying call stack trace for plugin "simpletk.smx":
    L 08/22/2008 - 22:295: [SM] [0] Line 168, /home/groups/alliedmodders/forums/files/3/9/5/3/8/30532.attach::AdminMenuHandler()
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    Cain
    SourceMod Donor
    Join Date: May 2005
    Location: South Carolina, USA
    Old 08-23-2008 , 00:56   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #7

    I'll test this tomorrow morning on my DOD:S OB serevr and provide feedback.

    This looks fantastic, and just what I was looking for !!
    Cain is offline
    Cain
    SourceMod Donor
    Join Date: May 2005
    Location: South Carolina, USA
    Old 08-23-2008 , 00:58   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #8

    Dude, I just read the top and I got a "shout out" !!

    Very cool, but you are the one who deserves the props !!

    <thumbs up man>
    Cain is offline
    Sgt-Mess
    Senior Member
    Join Date: Dec 2007
    Location: Sway Side,WA
    Old 08-23-2008 , 01:19   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #9

    Heres a screen shot from insurgency option 2 doesn't show up.




    And for a few suggestions for later releases is to add cvar's to plugin config so admin can choose what type of punishments are enforced on the team killer.

    EDIT: Sometimes when someone is team killed the plugin will say the client names, but sometimes it will say the server name example below.

    *** [STK] LOLOL did not forgive Sgt-Mess for tking.

    But other times it only said : *** [STK] FPSBanana Dingoland Insurgency did not forgive FPSBanana Dingoland Insurgency for tking.

    Last edited by Sgt-Mess; 08-23-2008 at 02:41.
    Sgt-Mess is offline
    Send a message via AIM to Sgt-Mess
    FeuerSturm
    Veteran Member
    Join Date: Apr 2004
    Location: Germany
    Old 08-23-2008 , 06:47   Re: Simple TK Manager v0.2 Updated 8/22/2008
    Reply With Quote #10

    @Lebson506th

    replace line 59:
    Code:
    new Hnadle:g_CvarMessage;
    with
    Code:
    new Handle:g_CvarMessage;
    to get rid of the "tag mismatch" warnings.


    replace line 155:
    Code:
    Format(yes, 127, "%t", "No");
    with
    Code:
    Format(no, 127, "%t", "No");
    to get the menu to display properly.
    FeuerSturm is offline
    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 22:27.


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