Results 1 to 6 of 6
  1. #1
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    913

    Insane Limits: Team Killing Manager V0.1

    I just want to share my Team Killing Manager to use with Insane Limits, which is probably the most powerful Procon Plugin.

    Features:

    • This limit allows player to forgive, punish or just ignore team kills.
    • Multiple team kills such as a stray grenade are counted as one team kill.
    • You can choose how many team kills you want to allow before a player will be killed, kicked and also banned if he/she doesn't stop TKs after he was already kicked.
    • Players TK score will be reduced after a configurable period.
    • It doesn't punish revive-, mine- and claymore-TKs
    • The TK-Manager kills, kicks, and bans players on TK if their TK-Score is above a configurable limit.


    Commands:

    A player can use the following commands:
    • No command will increase Team Killer's TK score by one.
    • !f forgives the last TK. Team Killer gets a message his last TK was forgiven by the victim. Team Killer's TK score will not be increased.
    • !p punishes the last TK. Team Killer gets a message his last TK was punished. He will be killed by an admin command and his TK score will be increased by two.


    Settings:

    You can choose your limits for admin warning, kill, kick and also the period after the TK-Counter will be decreased by changing the values of

    cooldown_seconds = 400;
    WarningCounter = 2;
    KickCounter = 4;

    • cooldown_seconds: After how many seconds the TK counter should be decreased automatically by one.
    • WarningCounter: The maximum TK counter until a player gets just a yell/chat message for a TK. If the TK counter is higher than this value, the player will be killed for a TK.
    • KickCounter: The maximum TK counter until a player gets just a yell/chat message for a TK. If the TK counter is higher than this value, the player will be kicked for a TK.



    How to use:

    Add 3 new_Limits

    First Limit
    name: TeamKill
    evaluation: OnTeamKill
    first check: Expression
    Code:
    kill.Weapon != "U_Medkit" && kill.Weapon != "U_Claymore" && kill.Weapon != "U_Claymore_Recon" && kill.Weapon != "U_M15" && kill.Weapon != "U_SLAM"
    second check: Code
    Code:
     if(limit.Activations(player.Name, TimeSpan.FromSeconds(1)) > 1)
        return false;
    	
    double 	cooldown_seconds 	= 400;
    int		WarningCounter		= 2;
    int		KillCounter			= 4;	
    
    if(!server.RoundData.issetInt(player.Name)) 
    	server.RoundData.setInt(player.Name, 0);
    
    if(!server.RoundData.issetDouble("#" + player.Name)) 
    	server.RoundData.setDouble("#" + player.Name, player.TimeRound);
    
    double Dinterval 	= player.TimeRound - server.RoundData.getDouble("#" + player.Name);
    int Iinterval		= Convert.ToInt32(Math.Floor(Dinterval/cooldown_seconds));	
    	
    int TKCounter 		= server.RoundData.getInt(player.Name) + 1 - Iinterval;
    TKCounter			= (TKCounter > 0) ? TKCounter : 1;
    
    server.RoundData.setInt(player.Name, TKCounter);
    victim.RoundData.setString(victim.Name, player.Name);
    server.RoundData.setDouble("#" + player.Name, player.TimeRound);
    	
    if( TKCounter <= WarningCounter) {
    	plugin.SendPlayerYell(player.Name, "\n******* Friendly Fire has been ENABLED! *******\n ******* WATCH YOUR FIRE *******", 10);
    	plugin.SendPlayerMessage(victim.Name, plugin.R("[Teamkill Punisher] > %k_n% has been WARNED for team kill!\nType !f to forgive or !p to punish the teamkill."));
    	plugin.PRoConChat(plugin.R("[Team Killer Punisher] > %p_n% has been WARNED for TK"));
    	}
    else if( TKCounter <= KillCounter) {
    	plugin.KillPlayer(player.Name);
    	plugin.SendPlayerMessage(victim.Name, plugin.R("[Teamkill Punisher] > %k_n% has been KILLED for team kill!\nType !f to forgive or !p to punish the teamkill."));
    	plugin.SendPlayerYell(player.Name, "\nYou've been killed for team kill. Please watch your fire!", 10);
    	plugin.SendPlayerMessage(player.Name, "You've been killed for team kill. Please watch your fire!");
    	plugin.PRoConChat(plugin.R("[Team Kille Punisher] > %p_n% has been KILLED for TK"));
    	}
    else {
    	if(server.RoundData.issetBool(player.Name)) {
    	  plugin.EABanPlayerWithMessage(EABanType.EA_GUID, EABanDuration.Temporary, player.Name, 120, "Too much team kills");
    	  }
    plugin.SendPlayerMessage(victim.Name, plugin.R("[Teamkill Punisher] > %k_n% has been KICKED for team kill!"));
    plugin.KickPlayerWithMessage(player.Name, "You've been kicked for too much team kills");
    plugin.PRoConChat(plugin.R("[Team Kille Punisher] > %p_n% has been KICKED for TK"));
    server.RoundData.setBool(player.Name, true);
    }
    
    return false;

    Second Limit
    name: Forgive
    evaluation: OnAnyChat
    first check: Expression
    Code:
    player.LastChat.Equals("!f", StringComparison.OrdinalIgnoreCase)
    second check: Code
    Code:
    if(player.RoundData.issetString(player.Name)) {
    	string Teamkiller 	= player.RoundData.getString(player.Name);
    	int TKCounter 		= server.RoundData.getInt(Teamkiller) - 1;	
    	server.RoundData.setInt(Teamkiller, TKCounter);
    	
    	plugin.PRoConChat(player.Name + " has forgiven " + Teamkiller + "'s teamkill");
    	plugin.SendPlayerMessage(player.Name, "You have forgiven " + Teamkiller + "'s teamkill");
    	plugin.SendPlayerMessage(Teamkiller, player.Name + " has forgiven your teamkill");
    	
    	player.RoundData.unsetString(player.Name);
    	}
    	
    return false;
    Third Limit
    name: Punish
    evaluation: OnAnyChat
    first check: Expression
    Code:
    player.LastChat.Equals("!p", StringComparison.OrdinalIgnoreCase)
    second check: Code
    Code:
    if(player.RoundData.issetString(player.Name)) {
    	string Teamkiller 	= player.RoundData.getString(player.Name);
    	int TKCounter 		= server.RoundData.getInt(Teamkiller) + 1;	
    	server.RoundData.setInt(Teamkiller, TKCounter);	
    	
    	plugin.PRoConChat(player.Name + " has punished " + Teamkiller + "'s teamkill");
    	plugin.SendPlayerMessage(player.Name, "You have punished " + Teamkiller + "'s teamkill");
    	plugin.SendPlayerMessage(Teamkiller, player.Name + " has punished your teamkill");
    	plugin.KillPlayer(Teamkiller);
    	
    	player.RoundData.unsetString(player.Name);
    	}
    	
    return false;
    Note
    Make sure that you don't use the ingame TK punisher. Disable it with server commands:
    Code:
    vars.teamKillCountForKick 0
    vars.teamKillKickForBan 0
    vars.teamKillValueForKick 0
    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  2. #2
    excellent limits.

    I have started using this and only this on my BF3 GunMaster server, works like a dream

    for bf3 server did make 2 changes...

    First Limit I changed
    first check: Expression code to

    Code:
    (true)
    then I added the following code to the beginning of

    First Limit
    second check: Code
    Code:
    if ((server.Gamemode == "GunMaster0") &&(Regex.Match(kill.Weapon, @"(?:M320|RPG|C4)", RegexOptions.IgnoreCase).Success))
    	return false;
    there has always been an issue with to many tk's with explossive weapons at end of rounds...

    Please note the added code was an idea swiped from papacharlie9 and edited by me ... _gp_

    thanks again for these limits

    _gp_


    BF3 GunMaster Rocks !!!
    Last edited by _gp_; 26-09-2015 at 22:57. Reason: ...always a thought...

  3. #3
    Can I add white list? or it is automatically maintained?
    welcome to our hardcore server CoCh HC RANKED 24/7 RUSH

  4. #4
    Quote Originally Posted by LumPenPacK View Post
    Note
    Make sure that you don't use the ingame TK punisher. Disable it with server commands:
    Code:
    vars.teamKillCountForKick 0
    vars.teamKillKickForBan 0
    vars.teamKillValueForKick 0
    The server becomes a Сustom. We unfortunately are not suitable.
    welcome to our hardcore server CoCh HC RANKED 24/7 RUSH

  5. #5
    Junior Member
    Join Date
    Feb 2014
    Location
    Magadan, Russia
    Posts
    23

    Talking

    A good script, is a pity I did not notice it before.

    But In all such scripts is not one simple thing - to ask for forgiveness.
    Can it somehow be implemented?
    Chat is full of apologies. Usually, if the TK apologized him not to responsible. But if TK was an intentional in chat starts squabble.
    This can be avoided if the player will have the opportunity punish him for TK. And TK will have the opportunity to quickly apologize using a simple and short command. Not in front of all participants in of the game, namely before the he killed whom. Subject to of course that the message will be sent to private.

    =======

    Please, add in the script command "!s" (sorry) to TK could ask for forgiveness before the he killed whom (in private message).
    And I think that the command "!f" is superfluous. If the player is not punish TK he forgave him by default.

    Thank you!
    Last edited by God_Zilla; 07-10-2015 at 13:06.

  6. #6
    @LumPenPacK This code seems to be working great for me, however I stumbled upon the problem of excluding an admin list in Insane Limits from the kick and !punish.

    Is there anyway you can add an exclusion with the last limit to prevent a certain amount of players, who are summed up in a list, to be excluded from this !punish command?

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •