Monthly Target: $400 Donations: $147
 36% 

TF2 Melee Mode v0.4 (8/25)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
chundo
Senior Member
Join Date: May 2008
Plugin ID:
416
Plugin Version:
0.4
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    106 
    Plugin Description:
    Force all players to use melee weapons.
    Old 06-06-2008 , 17:23   TF2 Melee Mode v0.4 (8/25)
    Reply With Quote #1

    TF2 Melee Mode v0.4 (8/25)

    When enabled, this plugin forces all players to use melee weapons. I
    t solves a few issues with other melee plugins I've found:
    • Fixes exploit where if the user attempts to change class in spawn to the same class they already are, no events are fired but the game gives them all their weapons back (thanks bl4nk).
    • When melee mode is disabled, players immediately get their weapons back - they don't have to wait to respawn again.
    CVars:

    sm_meleemode_version - Plugin version.
    sm_meleemode_enable - 1 is on, 0 is off. (default 0)

    Using From Other Plugins:

    I've included a meleemode.inc include which defines a "ForceMeleeMode(bool)" native, so that other plugins can enable/disable melee mode if they need to. I use this in a "Sudden Death Rules" plugin on my server.

    Installing:

    meleemode.smx -> addons/sourcemod/plugins/
    meleemode.sp -> addons/sourcemod/scripting/
    meleemode.inc (optional) -> addons/sourcemod/scripting/include/

    If Custom Votes is installed:
    meleemode.vote.cfg -> addons/sourcemod/configs/customvotes/

    Changelog:

    0.1 - Initial release
    0.2 - Changed exploit-blocking method (thanks bl4nk)
    0.3 - Fixed chat spam due to duplicate event hooks
    0.4 - Fixed a few exploits that granted all weapons

    Credits:

    Thanks to bl4nk for Sudden Death Melee Redux, which gave me a jump-start on figuring out how to write this.
    Attached Files
    File Type: inc meleemode.inc (433 Bytes, 5184 views)
    File Type: cfg meleemode.vote.cfg (209 Bytes, 5021 views)
    File Type: sp Get Plugin or Get Source (meleemode.sp - 13136 views - 4.1 KB)

    Last edited by chundo; 08-25-2008 at 19:20. Reason: Bad install instructions
    chundo is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 06-06-2008 , 17:54   Re: TF2 Melee Mode v0.1 (6/6)
    Reply With Quote #2

    Quote:
    Originally Posted by chundo View Post
    • Other melee plugins have an exploit where if the user attempts to change class in spawn to the same class they already are, no events are fired but the game gives them all their weapons back. To get around this I use a 1-second recurring timer to check if weapons need stripping throughout the round.
    I fixed this in my Sudden Death Melee Redux plugin by hooking the console cmd "equip" and stripping all weapons but the player's melee weapon.
    bl4nk is offline
    chundo
    Senior Member
    Join Date: May 2008
    Old 06-06-2008 , 18:01   Re: TF2 Melee Mode v0.1 (6/6)
    Reply With Quote #3

    Quote:
    Originally Posted by bl4nk View Post
    I fixed this in my Sudden Death Melee Redux plugin by hooking the console cmd "equip" and stripping all weapons but the player's melee weapon.
    Interesting, I'll try that out. Looks a lot simpler if it works.
    __________________

    Last edited by chundo; 06-06-2008 at 18:08.
    chundo is offline
    chundo
    Senior Member
    Join Date: May 2008
    Old 06-06-2008 , 18:28   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #4

    Much simpler, and eliminated the "slot3" menu problem too. Thanks!
    __________________
    chundo is offline
    air853
    Junior Member
    Join Date: Apr 2008
    Old 06-07-2008 , 02:48   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #5

    This is really cool, Thanks. By any chance could this be added to the source mod base menu (sm_admin)? That way any admin on my server could turn it on or off.
    air853 is offline
    chundo
    Senior Member
    Join Date: May 2008
    Old 06-07-2008 , 04:14   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #6

    Quote:
    Originally Posted by air853 View Post
    This is really cool, Thanks. By any chance could this be added to the source mod base menu (sm_admin)? That way any admin on my server could turn it on or off.
    If you're using a recent snapshot, you can do this pretty easily with custom admin menus. I'll think about doing it automatically for the next version though.
    __________________
    chundo is offline
    DJ Tsunami
    DJ Post Spammer
    Join Date: Feb 2008
    Location: Netherlands
    Old 06-09-2008 , 08:36   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #7

    I thought ClassChooser already had this feature? Why didn't bl4nk just update that
    __________________
    DJ Tsunami is offline
    chundo
    Senior Member
    Join Date: May 2008
    Old 06-09-2008 , 12:20   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #8

    Could be, I didn't really look at that plugin since I didn't need a class chooser . I just wrote this at the time because I wanted to fix the two bugs above on my server, and haven't dug too much into other melee plugins since then...
    __________________

    Last edited by chundo; 06-09-2008 at 12:30.
    chundo is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 06-09-2008 , 19:02   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #9

    It does, but I was running into some problems with the resupply cabinets not disabling for some reason. I'm not sure if chundo fixed it or not, but ClassChooser can do melee-only.

    [edit]

    After looking at this plugin's code, it seems he uses the same method I use in my ClassChooser. So, unless his plugin is blessed or something, it will probably produce the same problems mine does; where some of the resupply cabinets just won't disable for some reason.

    Last edited by bl4nk; 06-09-2008 at 19:05.
    bl4nk is offline
    chundo
    Senior Member
    Join Date: May 2008
    Old 06-09-2008 , 19:12   Re: TF2 Melee Mode v0.2 (6/6)
    Reply With Quote #10

    I haven't seen that yet - is there any specific case that this happens under so I can test it out?
    __________________
    chundo 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 12:45.


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