View Single Post
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
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, 2983 views)
File Type: txt equipwearable.txt (323 Bytes, 1662 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 10-31-2014 at 11:12.
Powerlord is offline