AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [TF2] Weapon Restrictions (https://forums.alliedmods.net/showthread.php?t=238130)

Powerlord 04-04-2014 17:26

[TF2] Weapon Restrictions
 
2 Attachment(s)
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.

Powerlord 04-04-2014 18:24

Re: [TF2] Weapon Restrictions
 
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"
        }
    }
}


island55 04-04-2014 23:53

Re: [TF2] Weapon Restrictions
 
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."
}

Powerlord 04-09-2014 10:55

Re: [TF2] Weapon Restrictions
 
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.

7106 04-15-2014 05:40

Re: [TF2] Weapon Restrictions
 
can u make simple plugin?
spy no cloak & disguise
please help me!

SuperU 05-09-2014 12:47

Re: [TF2] Weapon Restrictions
 
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

Powerlord 05-09-2014 17:13

Re: [TF2] Weapon Restrictions
 
Quote:

Originally Posted by SuperU (Post 2135632)
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).

SuperU 05-12-2014 16:27

Re: [TF2] Weapon Restrictions
 
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.

SuperU 05-19-2014 23:31

Re: [TF2] Weapon Restrictions
 
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

Powerlord 05-20-2014 21:22

Re: [TF2] Weapon Restrictions
 
Quote:

Originally Posted by SuperU (Post 2140145)
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.


All times are GMT -4. The time now is 06:03.

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