Results 1 to 3 of 3

Thread: no shotgun

  1. #1

    no shotgun

    looking to modify this, we are running this on our server for no stingers, is it possible to use something like this so it would kill for using a shotgun??

    evaluation: onkill
    first check: code

    String autoKilled = "{0} AUTO-KILLED for using the PROHIBITED {1}";
    String autoKicked = "{0} AUTO-KICKED for using the PROHIBITED {1}";
    String tempBan = "{0} TEMP BAN 1 HOUR for using the PROHIBITED {1}";
    String yellKilled = "The {1} is prohibited. You will be AUTO-KICKED if you use it again.";

    // Times
    int yellTime = 20; // seconds
    int banTime = 60; // minutes
    double multiKillTime = 10; // seconds

    // Weapon codes

    bool isMAA = Regex.Match(kill.Weapon, @"(U_FIM92)").Success;

    /* CODE */

    if (!isMAA) return false;

    String prohibited = "Anti-Air";

    String key = "Read Rules! " + prohibited + "_" + killer.Name;

    int count = 0;
    if (plugin.Data.issetInt(key)) count = plugin.Data.getInt(key);

    DateTime last = DateTime.MinValue;
    if (server.Data.issetObject(key)) last = (DateTime)server.Data.getObject(key);
    if (DateTime.Now.Subtract(last).TotalSeconds <= multiKillTime) return false;
    server.Data.setObject(key, (Object)DateTime.Now);

    count = count + 1;

    String msg = null;

    if (count == 1) { // First Violation: Kill

    msg = String.Format(autoKilled, killer.Name, prohibited);
    plugin.SendGlobalMessage(msg);
    plugin.SendPlayerYell(killer.Name, String.Format(yellKilled, killer.Name, prohibited), yellTime);
    plugin.PRoConChat("ADMIN > " + msg);
    plugin.PRoConEvent(msg, "Insane Limits");
    plugin.KillPlayer(killer.Name, 6);

    } else if (count == 2) { // Second Violation: Kick

    msg = String.Format(autoKicked, killer.Name, prohibited);
    plugin.SendGlobalMessage(msg);
    plugin.PRoConChat("ADMIN > " + msg);
    plugin.PRoConEvent(msg, "Insane Limits");
    plugin.KickPlayerWithMessage(killer.Name, msg);

    } else { // Third or subsequent Violation: TBan

    msg = String.Format(tempBan, killer.Name, prohibited);
    plugin.SendGlobalMessage(msg);
    plugin.PRoConChat("ADMIN > " + msg);
    plugin.PRoConEvent(msg, "Insane Limits");
    plugin.EABanPlayerWithMessage(EABanType.Name, EABanDuration.Temporary, killer.Name, banTime, msg);

    }

    plugin.Data.setInt(key, count);
    return false;


    also instead of kill the first would just like to warn then kill
    thank you
    Last edited by HeLLz_Overkill; 17-08-2015 at 18:15. Reason: added to post

  2. #2
    Community Contributor
    Join Date
    Nov 2011
    Posts
    3,036
    Why didn't you ask in the insane limits thread? You are using someone else's insane limits code and wondering if it can be modified for shotguns instead of IGLA? Of course it can be modified.

  3. #3
    mod please delete this then I will ask in the right thread then, looks like my edited post inst showing here, new here sorry this is where I asked about something else last week or so

 

 

Posting Permissions

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