Raised This Month: $32 Target: $400
 8% 

Weapon Blocker 1.3


Post New Thread Reply   
 
Thread Tools Display Modes
Author
MikeJS
Senior Member
Join Date: Nov 2008
Plugin ID:
789
Plugin Version:
1.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    8 
    Plugin Description:
    Stop people from using certain weapons.
    Old 03-01-2009 , 06:42   Weapon Blocker 1.3
    Reply With Quote #1

    Stops people from using weapons specfied in a cvar.

    Cvars:
    sm_wpnblock - Enable/disable plugin

    Commands:
    sm_wpnblock_add - Add a blocked weapon.
    sm_wpnblock_clear - Clear list of blocked weapons.
    sm_wpnblock_list - List blocked weapons.

    Example:
    Code:
    sm_wpnblock "1"
    sm_wpnblock_clear
    sm_wpnblock_add "tf_weapon_flaregun"
    sm_wpnblock_add "tf_weapon_pipebomblauncher" // Blocks flareguns and sticky launchers
    TF2 Weapons:
    Scout: tf_weapon_scattergun (both scatterguns), tf_weapon_pistol_scout, tf_weapon_lunchbox_drink, tf_weapon_bat, tf_weapon_bat_wood
    Soldier: tf_weapon_rocketlauncher, tf_weapon_shotgun_soldier, tf_weapon_shovel
    Pyro: tf_weapon_flamethrower (both flamethowers), tf_weapon_shotgun_pyro, tf_weapon_flaregun, tf_weapon_fireaxe (both axes)
    Demoman: tf_weapon_grenadelauncher, tf_weapon_pipebomblauncher, tf_weapon_bottle
    Heavy: tf_weapon_minigun (both miniguns), tf_weapon_shotgun_hwg, tf_weapon_lunchbox, tf_weapon_fists (both fists)
    Engineer: tf_weapon_shotgun_primary, tf_weapon_pistol, tf_weapon_wrench, tf_weapon_pda_engineer_destroy, tf_weapon_pda_engineer_build (people can still use console commands to build)
    Medic: tf_weapon_syringegun_medic (both syringe guns), tf_weapon_medigun (both mediguns), tf_weapon_bonesaw (both saws)
    Sniper: tf_weapon_sniperrifle, tf_weapon_smg, tf_weapon_club
    Spy: tf_weapon_revolver, SAPPER?, tf_weapon_knife, tf_weapon_pda_spy (can still disguise with console commands)
    Attached Files
    File Type: sp Get Plugin or Get Source (wpnblock.sp - 6727 views - 2.5 KB)

    Last edited by MikeJS; 05-14-2009 at 08:17.
    MikeJS is offline
    Flashback
    SourceMod Donor
    Join Date: May 2008
    Old 03-01-2009 , 07:39   Re: TF2 Weapon Blocker
    Reply With Quote #2

    This is crazy. I was just trying to figure out a way to strip weapons by only using Sourcemod. Thanks a lot.

    However, I just noticed that sm_wpnblock_rem isn't working properly. If you add too many weapons, the server is just gonna ignore the command. The plugin seems to work fine otherwise.

    Last edited by Flashback; 03-01-2009 at 07:46.
    Flashback is offline
    MikeJS
    Senior Member
    Join Date: Nov 2008
    Old 03-01-2009 , 07:53   Re: TF2 Weapon Blocker
    Reply With Quote #3

    It should work with up to 32 weapons.
    MikeJS is offline
    CrimsonGT
    Veteran Member
    Join Date: Oct 2007
    Location: Gainesville, FL
    Old 03-01-2009 , 08:10   Re: TF2 Weapon Blocker
    Reply With Quote #4

    lol, I wrote this yesterday out of boredom, functions pretty much the exact same way. I just hadn't had time to get all the weapon names yet so I didnt release it. Nice plugin though. +karma for stopping a bunch of future plugin requests.
    __________________
    CrimsonGT is offline
    Flashback
    SourceMod Donor
    Join Date: May 2008
    Old 03-01-2009 , 08:23   Re: TF2 Weapon Blocker
    Reply With Quote #5

    Quote:
    Originally Posted by MikeJS View Post
    It should work with up to 32 weapons.
    Well this is what I get in the server console:
    Code:
    WARNING: Command too long... ignoring!
    sm_cvar sm_wpnblock_rem "tf_weapon_bat, tf_weapon_bat_wood, 
    tf_weapon_bonesaw,
     tf_weapon_flaregun, tf_weapon_bottle, tf_weapon_builder, tf_weapon_club, 
    tf_weapon_fireaxe, tf_weapon_fists,
      tf_weapon_flamethrower, tf_weapon_flaregun, 
    tf_weapon_grenadelauncher, tf_weapon_knife, tf_weapon_minigun, 
    tf_weapon_pistol, tf_weapon_pistol_scout, tf_weapon_revolver, 
    tf_weapon_rocketlauncher, tf_weapon_scattergun, 
    tf_weapon_shotgun_hwg, tf_weapon_shotgun_primary, 
    tf_weapon_shotgun_pyro, tf_weapon_shotgun_soldier, tf_weapon_shovel, 
    tf_weapon_smg, tf_weapon_sniperrifle, tf_weapon_syringegun_medic, 
    tf_weapon_wrench, tf_weapon_pipebomblauncher"
    Cbuf_AddText: buffer overflow
    Flashback is offline
    MikeJS
    Senior Member
    Join Date: Nov 2008
    Old 03-01-2009 , 09:24   Re: TF2 Weapon Blocker
    Reply With Quote #6

    Quote:
    Originally Posted by Flashback View Post
    Well this is what I get in the server console:
    Code:
    WARNING: Command too long... ignoring!
    sm_cvar sm_wpnblock_rem "tf_weapon_bat, tf_weapon_bat_wood, 
    tf_weapon_bonesaw,
     tf_weapon_flaregun, tf_weapon_bottle, tf_weapon_builder, tf_weapon_club, 
    tf_weapon_fireaxe, tf_weapon_fists,
      tf_weapon_flamethrower, tf_weapon_flaregun, 
    tf_weapon_grenadelauncher, tf_weapon_knife, tf_weapon_minigun, 
    tf_weapon_pistol, tf_weapon_pistol_scout, tf_weapon_revolver, 
    tf_weapon_rocketlauncher, tf_weapon_scattergun, 
    tf_weapon_shotgun_hwg, tf_weapon_shotgun_primary, 
    tf_weapon_shotgun_pyro, tf_weapon_shotgun_soldier, tf_weapon_shovel, 
    tf_weapon_smg, tf_weapon_sniperrifle, tf_weapon_syringegun_medic, 
    tf_weapon_wrench, tf_weapon_pipebomblauncher"
    Cbuf_AddText: buffer overflow
    That's...odd. Have you tried setting the cvar with rcon rather than sm_cvar?
    MikeJS is offline
    CrimsonGT
    Veteran Member
    Join Date: Oct 2007
    Location: Gainesville, FL
    Old 03-01-2009 , 09:52   Re: TF2 Weapon Blocker
    Reply With Quote #7

    The string is too long for a CVAR. Your going to need to either move it over to use a config file, or seperate it up to use a boolean cvar for each weapon would be my guess.
    __________________
    CrimsonGT is offline
    Flashback
    SourceMod Donor
    Join Date: May 2008
    Old 03-01-2009 , 10:51   Re: TF2 Weapon Blocker
    Reply With Quote #8

    Quote:
    Originally Posted by MikeJS View Post
    That's...odd. Have you tried setting the cvar with rcon rather than sm_cvar?
    Yes, same results.
    Flashback is offline
    MikeJS
    Senior Member
    Join Date: Nov 2008
    Old 03-01-2009 , 11:29   Re: TF2 Weapon Blocker
    Reply With Quote #9

    If anyone desperately wants their server to become "who dies from fall damage or old age first" then I'll fix it.
    MikeJS is offline
    Flashback
    SourceMod Donor
    Join Date: May 2008
    Old 03-01-2009 , 11:44   Re: TF2 Weapon Blocker
    Reply With Quote #10

    Quote:
    Originally Posted by MikeJS View Post
    If anyone desperately wants their server to become "who dies from fall damage or old age first" then I'll fix it.
    Well, yes I would, if it isn't too much of a problem. This is a perfect plugin for my server.
    Flashback 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 20:34.


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