Raised This Month: $12 Target: $400
 3% 

[TF2] Weapon Restrictions


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Plugin ID:
4157
Plugin Version:
1.0.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Load a set of weapon restrictions
    Unapprover:
    Reason for Unapproving:
    no longer maintained by author
    Old 04-04-2014 , 17:26   [TF2] Weapon Restrictions
    Reply With Quote #1

    Description
    [TF2] Weapon Restrictions is a plugin to restrict weapons to only specific weapons and disallow all others.

    Weapon lists are loaded from configuration files in the sourcemod/configs/tf2-weapon-restrictions directory. Weapons can be specified either by class or by item definition index.

    Dependencies
    SourceMod 1.5.0 or newer
    TF2Items 1.6.0 or newer

    Features
    • Weapon Restriction Lists can be changed on the fly.
    • Has a forward that is called whenever weapon sets are changed:
      Code:
      public TF2WeaponRestrictions_RestrictionChanged(const String:restrictionName[])
    • Plugins can change weapon sets using the native
      Code:
      TF2WeaponRestrictions_SetRestriction(const String:restrictionName[]);
    • Has options to restrict buildings, wearables, action slot items, etc...
    • Has option to default to blacklist (allow nothing except listed items) or whitelist (allow everything except listed items)
    • Sample files included are: melee (melee only, all classes), medieval (Medieval mode), meleeplus (not finished, imitates the TF2 Melee plugin's melee_mode 0 restrictions)

    CVars/Commands
    CVars
    • tf2_weapon_restrictions_version - Displays the version number
    • tf2_weapon_restrictions_enable - Set to 0 to disable plugin.

    Commands
    • weaponrestrict [setname] - Loads a weapon restriction set. Set to "none" to unload all restrictions. Restricted to admin Kick flag by default.
    Changelog

    • 2014-04-02 (1.0.0)
      • Initial release
    Known Issues
    • If an Engineer is alive when weapon loadouts are changed, his buildings will all be destroyed due to Valve's wrench change mechanic.
    • Switching item sets will heal all currently alive players to full.

    Future Plans
    • Eventually, this plugin will support changing weapons when a player spawns. However, this has one major drawback: Doing it for Engineer melee weapons will cause their buildings to blow up when they respawn.
    • Subplugins for voting will eventually come around
    • A subplugin for sudden death will probably be around soon.
    Attached Files
    File Type: zip tf2-weapon-restrictions.zip (37.1 KB, 2973 views)
    File Type: txt equipwearable.txt (323 Bytes, 1657 views)
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 10-31-2014 at 11:12.
    Powerlord is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 04-04-2014 , 18:24   Re: [TF2] Weapon Restrictions
    Reply With Quote #2

    Reserved for configs and things.

    Sample Whitelist

    Here's a configuration that allows everything except the Spy's cloaking devices and disguise kit:

    Code:
    "weapon_restrictions"
    {
        "name"                "Spy Restrictions"
        "default"            "allow"
    
        "allow_buildings"        "1"
        "allow_action_items"        "1"
    
        "classes"
        {
            "tf_weapon_pda_spy"
            {
                "deny"        "1"
            }
    
            "tf_weapon_invis"
            {
                "deny"        "1"
            }
        }
    }
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 05-08-2014 at 11:34.
    Powerlord is offline
    island55
    Senior Member
    Join Date: Aug 2010
    Location: charleston
    Old 04-04-2014 , 23:53   Re: [TF2] Weapon Restrictions
    Reply With Quote #3

    wow i've been wanting a working weapon restriction plugin for the longest.. excellent

    edit: you've got a typo in the phrases file;

    Quote:
    "TWR Command Usage"
    {
    "en" "Usage: weaponrestrict <name>. <name> can be \"none\" or \"\" to reset to stamdard."
    }

    Last edited by island55; 04-04-2014 at 23:57.
    island55 is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 04-09-2014 , 10:55   Re: [TF2] Weapon Restrictions
    Reply With Quote #4

    I'm going to be trying some things to fix Spies having disguise weapons that aren't allowed. I think I can duplicate what Valve does using SDKHooks, but I'll have to check if it actually works.
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 04-09-2014 at 10:56.
    Powerlord is offline
    7106
    Senior Member
    Join Date: Jun 2013
    Old 04-15-2014 , 05:40   Re: [TF2] Weapon Restrictions
    Reply With Quote #5

    can u make simple plugin?
    spy no cloak & disguise
    please help me!
    7106 is offline
    SuperU
    Member
    Join Date: Feb 2014
    Location: Panama
    Old 05-09-2014 , 12:47   Re: [TF2] Weapon Restrictions
    Reply With Quote #6

    What is the difference between tNoUnlocksPls, WeaponBlocker with this plugin.?


    May unlock only reskins here or i cant? i only need stock weapons and reskins.


    Have a nice day sorry to bother you
    SuperU is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 05-09-2014 , 17:13   Re: [TF2] Weapon Restrictions
    Reply With Quote #7

    Quote:
    Originally Posted by SuperU View Post
    What is the difference between tNoUnlocksPls, WeaponBlocker with this plugin.?


    May unlock only reskins here or i cant? i only need stock weapons and reskins.


    Have a nice day sorry to bother you
    This plugin's main feature is the ability to switch weapon sets on the fly. As far as I know, it's the only plugin that does this. It also has a native so that other plugins can change weapon sets as well.

    Unlike the other plugins, this plugin can block weapons both by classname and by Item Definition index. It can block cosmetic items by their item definition index. It can block cosmetic action items (but Valve prevents you from blocking the actual item). It can also block Engineer buildings (all of them or just specific ones, including sappers). In a blacklist (the default mode), you can choose to blacklist all tf_weapon_minigun, then whitelist just the stock minigun by its item definition indexes if you so choose.

    It's actually a convergence of two plugins I was working on... the first was a plugin to let me switch between Medieval Mode and regular mode without a map change. The second was a replacement for the Melee Only plugin after I started having random crashes with it.

    Unfortunately, I haven't yet ported the weapon replacement logic from PropHunt Redux to this plugin yet, so it only supports blocking at the moment.

    Class-specific blocking and replacements will eventually be coming (for example, PropHunt Redux replaces the Pyro's Reserve Shooter with the Shotgun, but leaves the Soldier's Reserve Shooter alone).
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 05-09-2014 at 17:18.
    Powerlord is offline
    SuperU
    Member
    Join Date: Feb 2014
    Location: Panama
    Old 05-12-2014 , 16:27   Re: [TF2] Weapon Restrictions
    Reply With Quote #8

    Sorry to bother you again, but i couldn't make the plugin work i'm doing something wrong when i set the configs for some reason doesn't work. I also have some problems with the configs the file don't load automatically and i need use the console and type weaponrestrict file name.

    Could you provide me a example how you block some fists except the reskins and stock fists. You don't need need block all the fists only two fists blocked and one fist unlocked for the example.
    Have a nice day.

    Last edited by SuperU; 05-14-2014 at 15:28.
    SuperU is offline
    SuperU
    Member
    Join Date: Feb 2014
    Location: Panama
    Old 05-19-2014 , 23:31   Re: [TF2] Weapon Restrictions
    Reply With Quote #9

    I guess i'm so close to finish config this plugin,but i have one more question

    How you use the option to default to blacklist (allow nothing except listed items)?

    This is my example how i have the config file

    Quote:
    "weapon_restrictions"
    {
    "name" "restriction"
    "default" "deny"

    "allow_buildings" "0"
    "allow_action_items" "1"


    "indexes"
    {
    "587"
    {
    "name" "Apoco-Fists "
    "deny" "1"
    }

    "5"
    {
    "name" "Fists"
    "allow" "1"
    }

    "195"
    {
    "name" "Fists (Renamed/Strange)"
    "deny" "1"
    }

    "43"
    {
    "name" "The Killing Gloves Of Boxing"
    "deny" "1"
    }

    "239"
    {
    "name" "Gloves of Running Urgently"
    "deny" "1"
    }

    "264"
    {
    "name" "Frying Pan"
    "deny" "1"
    }


    }
    }
    Have a nice day tomorrow sorry to bother you

    Last edited by SuperU; 05-19-2014 at 23:35.
    SuperU is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 05-20-2014 , 21:22   Re: [TF2] Weapon Restrictions
    Reply With Quote #10

    Quote:
    Originally Posted by SuperU View Post
    I guess i'm so close to finish config this plugin,but i have one more question

    How you use the option to default to blacklist (allow nothing except listed items)?

    This is my example how i have the config file


    Have a nice day tomorrow sorry to bother you
    "default" "deny" makes it so only the listed items are allowed. "default" "allow" would make it so only the listed items are blocked.
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord 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 09:34.


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