Results 1 to 4 of 4
  1. #1

    Insane Limits: MAA punishment (like TK !punish)

    Quote Originally Posted by IAF SDS View Post
    Punish MAA limit

    Each time an MAA kill is tracked, the victim will be able to type @MAA in any chat to auto-kill the MAA. This will make the MAA just as undesirable as the aircraft, because it will be susceptible to dying the same amount (instead of remaining invincible in it's uncap to rape all of the aircraft from across the map). But the players would use their own discretion in using it. This would work the same way the @punish system works for teamkillers, but there would not be any forgive command of course.

    This private chat message would be sent to the victim once the kill was tracked as an MAA kill:
    PlayerNameVictim: Type @MAA now to AUTO-KILL your killer in the overpowered Mobile-AA vehicle if you're sick of it!

    The victim would have 30 seconds to execute the @MAA command, otherwise it would expire.

    If the victim timely executed the @MAA command, this public chat message would be sent:
    Victim PlayerNameVictim AUTO-KILLED the Mobile-AA user PlayerNameKiller by typing @MAA in chat.

    An optional second public message would be sent 10 seconds later (can comment out if we don't want to use it):
    The overpowered Mobile-AA vehicle is discouraged from camping near its base. Victims have the discretion to auto-kill it.

    There would not be any kicks nor any further action, just @MAA kills only when the victim timely used it.
    I wasn't able to do the 10 second delay message, that's too hard. I did everything else, though, including max kills without a punishment.

    This requires 2 limits. Anything with // CHANGE at the end of the line is a message or a variable that you can change, like max kills or the message sent to the victim.

    First Limit

    Create a limit to evaluate OnKill, call it "Track MAA Kills".

    Set first_check to this Code:

    Code:
    /* R1 */
    if (!Regex.Match(kill.Weapon, @"(LAV_AD|Tunguska|PGZ-95)").Success)
        return false;
    
    int maxKills = 6; // CHANGE
    String key = "Last_MAA";
    int count = 0;
    String weapon = plugin.FriendlyWeaponName(kill.Weapon).Name;
    plugin.PRoConChat("MAA log > " + victim.Name + " was killed by " + killer.Name + " with " + weapon);
    
    if (killer.RoundData.issetInt(key))
        count = killer.RoundData.getInt(key);
    count = count + 1;
    killer.RoundData.setInt(key, count);
    if (count > maxKills) {
        plugin.SendPlayerMessage(killer.Name, "You've got more than " + maxKills + " kills with the MAA, go do something else!");
        plugin.KillPlayer(killer.Name, 3);
        return false;
    }
    
    victim.RoundData.setString(key, killer.Name);
    victim.RoundData.setObject(key, (Object)DateTime.Now);
    //plugin.ConsoleWrite("MAA log: ^7^b" + victim.Name + "^n was killed by ^b" + killer.Name + " with " + weapon);
    plugin.SendPlayerMessage(victim.Name, "Type @MAA now to AUTO-KILL " + killer.Name + " in the overpowered Mobile-AA vehicle if you're sick of it!"); // CHANGE
    return false;
    Second Limit

    Create a limit to evaluate OnAnyChat, call it "Punish MAA".

    Set first_check to this Code:

    Code:
    double timeToPunishSeconds = 60; // victim has 60 seconds to punish MAA killer
    String key = "Last_MAA";
    
    if (Regex.Match(player.LastChat, @"^\s*[[email protected]#]MAA", RegexOptions.IgnoreCase).Success) {
        if (!player.RoundData.issetObject(key) || !player.RoundData.issetString(key)) {
            plugin.SendPlayerMessage(player.Name, "You are not eligible to use the MAA punishment!");
            return false;
        }
        DateTime last = (DateTime)player.RoundData.getObject(key);
        String maaDriver = player.RoundData.getString(key);
        if (DateTime.Now.Subtract(last).TotalSeconds > timeToPunishSeconds) {
            plugin.SendPlayerMessage(player.Name, "More than " + timeToPunishSeconds + " seconds have passed since the MAA kill, it's too late to punish");
            player.RoundData.unsetString(key);
            player.RoundData.unsetObject(key);
            return false;
        }
        // Punishment
        plugin.SendPlayerMessage(player.Name, maaDriver + " will be punished in 5 seconds!");
        //plugin.ConsoleWrite("MAA log: victim ^7^b" + player.Name + "^n punished ^b" + maaDriver + " for MAA killing!");
        String msg = "Victim " + player.FullName + " AUTO-KILLED the Mobile-AA user " + maaDriver + " by typing @MAA in chat";
        plugin.SendGlobalMessage(msg);
        plugin.SendPlayerYell(maaDriver, "You have been punished for MAA killing!", 10); // CHANGE
        plugin.PRoConChat("ADMIN to " + maaDriver + " > " + msg);
        plugin.KillPlayer(maaDriver, 5);
    
        // First-come, first-served
        List<PlayerInfoInterface> all = new List<PlayerInfoInterface>();
        all.AddRange(team1.players);
        all.AddRange(team2.players);
        foreach (PlayerInfoInterface p in all) {
            if (!p.RoundData.issetString(key))
                continue;
            if (p.RoundData.getString(key) != maaDriver)
                continue;
            p.RoundData.unsetString(key);
            p.RoundData.unsetObject(key);
        }
    }
    return false;
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  2. #2
    Man, you're fast. Very nice and thank you!

    I had replied to your questions in the requests thread, without seeing your reply. So I moved my response here.

    Your idea to have it first come, first served is great. Would it be hard to add a reply to the other victims who typed @MAA within the time frame in the form of a private message like this:
    PlayerNameVictim2: The Mobile-AA vehicle was already auto-killed by PlayerNameVictim1.


    Regarding the auto kill if no one uses @MAA in X number of kills (Im not sure if you already added this), it's a great idea, but a tough choice. If I could reliably let the players use their discretion, that would be much better. But the option is nice and might come in handy. You could add this feature and if we don't want it to trigger, we could just set the X number of kills needed to something like 100, which would effectively mean it won't trigger.

    If you want to add it, we should send this private message only to the MAA user:
    PlayerNameMAA: You were auto-killed in the Mobile-AA on behalf of the Players.

    EDIT:
    LOL I just read your message for the punish when no one punishes on X kills, and it will work just fine:
    You've got more than " + maxKills + " kills with the MAA, go do something else!
    Last edited by IAF SDS; 15-04-2014 at 22:14.

  3. #3
    You can set maxKills to a high number, like 100, to effectively disable it if you don't want it.

    I made the private message to the MAA driver being punished be a yell.
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  4. #4
    Hi,
    Is this working on BF4?
    It tracks the kills , gives the message to type @MMA, but it doesn't kill the player

    Thanks

 

 

Posting Permissions

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