Raised This Month: $89 Target: $400
 22% 

[ANY] No Double Push (2.4.6, 2015-12-05)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Chanz
Veteran Member
Join Date: Aug 2008
Location: Germany - Stuttgart
Plugin ID:
1811
Plugin Version:
2.4.6
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    2 
    Plugin Description:
    Locks func_button and func_rot_button entities for a certain amount of time, to prevent double pushing on deathrun or other maps.
    Old 07-17-2010 , 11:33   [ANY] No Double Push (2.4.6, 2015-12-05)
    Reply With Quote #1

    Code:
    /* 
    * No Double Push - Locks buttons.
    * 
    * 
    * Description:
    * Locks func_button and func_rot_button entities for a certain amount of time, to prevent double pushing on deathrun or other maps.
    * 
    * 
    * Installation:
    * Place the 'nodoublepush.smx' into your "<moddir>/addons/sourcemod/plugins" folder.
    * Place the 'plugin.nodoublepush.cfg' into your "<moddir>/cfg/sourcemod/" folder.
    * 
    * 
    * Configuration:
    * sm_nodoublepush_enable - Enable or disable No Double Push.
    * sm_nodoublepush_time - The time in seconds, when the button should be unlocked again. -1 will never unlock the buttons again.
    * sm_nodoublepush_deathrun - How to handle deathrun maps: 0 this plugin is always on, 1 this plugin is only on deathrun maps on, 2 this plugin is only on deathrun maps off.
    * sm_nodoublepush_triggertime - Only change the time of buttons if the original time (in seconds) is greater than this value (in seconds).
    * sm_nodoublepush_enablecolor - If this is set to 1 every button turns red when locked. By setting this to 0 the buttrons never change color.
    *
    * 
    * Changelog:
    * 05.12.2015 - v2.4.6 - Added cvar to disable colors
    *
    * 15.08.2010 - v2.4.5 if you use this in CSS it's recommanded that you update to this version!
    * Rewrite of the hole code to prevent double push.
    * Changed: Instead of deleting or chaning the buttons return time, this plugin now locks all buttons for a certain time.
    * Added: Func_butttons are now red if they are locked.
    * Added: On plugin unload all buttons return to their normal behavior.
    * 
    * 19.07.2010 - v1.2.0
    * Fixed in CSS that round_start event is setting back the old values from the map.
    * 
    * v1.1.0
    * Added sm_nodoublepush_triggertime to prevent no trap buttons are only once pushable.
    * 
    * v1.0.0
    * Public release.
    * 
    * 
    * Thank you Berni and SourceMod/AlliedModders-Team
    * Thank you thetwistedpanda for letting me know about that the buttons won't keep their assigned time.
    */
    Download:
    Attached Files
    File Type: sp Get Plugin or Get Source (nodoublepush.sp - 363 views - 7.7 KB)
    File Type: cfg plugin.nodoublepush.cfg (870 Bytes, 156 views)
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]

    Last edited by Chanz; 12-05-2015 at 08:14.
    Chanz is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 07-18-2010 , 19:50   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #2

    As I mentioned in another topic, that method doesn't exactly work. Printing the logs to chat will show that the entity has accepted your dispatched value, but buttons continue to function normally and a stripper_dump will show that the entities retain their true wait value. If you try it on a map that has a low recovery time, such as dr_manylevelsofhell_fix4 (20 seconds), you'll see that buttons recover normally.
    __________________
    thetwistedpanda is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 07-18-2010 , 20:02   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #3

    Could it be because of a round restart or do the buttons reset in the same round?
    Its strange that this won't work with buttons, I've using the same code for a long time now in hl2dm to let func_doors stay open when used once.

    Do you know, when the buttons retain their true value? When pressed or on just the next frame?
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
    Chanz is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 07-18-2010 , 20:07   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #4

    It's quite possible they're being reset on round restart, I never thought of that, and I've never ran a stripper dump before that period. All I know is I fiddled with the code for weeks with every combination of ints/strings/floats possible and buttons refused keep the values that were dispatched to them. I'll try to test it on my server and get back to you, not sure when that'll be.
    __________________

    Last edited by thetwistedpanda; 07-18-2010 at 20:11.
    thetwistedpanda is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 07-18-2010 , 20:43   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #5

    Update: I tested the code on both steamworks and sunnyday, and the buttons are definitely being reset after the values are being assigned. However, I'm not sure if it's after round_start or if it's being done every game frame. A stripper dump shows that the values have already been reset after a round has been started, so I'm inclined to believe it's being done per frame. Using Stripper: Source, however, I'm able to set all wait values to "-1" when the map loads and those values remain. So perhaps we should look for a function that fires prior to OnMapStart?

    According to dirka_dirka, round_start and round_start_post_nav fire once prior to OnMapStart.
    __________________

    Last edited by thetwistedpanda; 07-18-2010 at 20:47. Reason: Language fail.
    thetwistedpanda is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 07-18-2010 , 20:49   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #6

    Code:
    Changed button (463) wait time from -333.000000 to -1.000000
    Changed button (464) wait time from -333.000000 to -1.000000
    Changed button (474) wait time from -333.000000 to -1.000000
    ######round restart#######
    Changed button (202) wait time from -1.000000 to 15.000000
    Changed button (212) wait time from -1.000000 to 15.000000
    Changed button (287) wait time from -1.000000 to 30.000000
    Some examples -333.0 is init value of an array.
    It was indeed the round_start that changed some buttons back to their normal values.
    I'll add the changes and reupload the plugin in some minutes.

    edit: updated to 1.2.0
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]

    Last edited by Chanz; 07-18-2010 at 21:00.
    Chanz is offline
    thetwistedpanda
    Good Little Panda
    Join Date: Sep 2008
    Old 07-18-2010 , 21:48   Re: No Double Push - Set return time (wait) of buttons (works for any game)
    Reply With Quote #7

    If you set the wait value to -1 after the entity has been spawned, it is effectively the same as setting the recovery time to 0. Instead you probably want to use a large number otherwise the buttons instantly recover.
    __________________
    thetwistedpanda is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 08-15-2010 , 16:12   Re: No Double Push - Locks buttons. (works for any game)
    Reply With Quote #8

    updated to v2.4.5
    see first post for changelog.
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
    Chanz is offline
    Crimepack
    Junior Member
    Join Date: Nov 2009
    Old 09-08-2010 , 13:53   Re: No Double Push - Locks buttons. (works for any game)
    Reply With Quote #9

    Im running an HL2DM Server, is it possible to lock the vent in dm_lockdown!

    Hope you know which map and vent i mean! :-D

    I installed your plugin, but nothing happened to the button, the vent turns and then the plug disconnected, i want to block / lock this! Hope you can help me to solve my problem!

    Thanks for reply.
    Crimepack is offline
    Chanz
    Veteran Member
    Join Date: Aug 2008
    Location: Germany - Stuttgart
    Old 09-16-2010 , 18:40   Re: No Double Push - Locks buttons. (works for any game)
    Reply With Quote #10

    Yes I know the vent shaft on lockdown.
    This plugin isn't able to block the ventilator in dm_lockdown.

    If you pay me 15$ then I'll code you a single plugin especially for dm_lockdown.
    __________________
    [ SourceModPlugins.org ][ My Plugins ]

    Thank you for donations: [ Paypal ]

    Video Tutorial (German): [ Gameserver & SourceMod Plugins mit HLSW verwalten ]
    Chanz 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 00:53.


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