AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Ledge Release (https://forums.alliedmods.net/showthread.php?t=316508)

Dragokas 05-26-2019 11:11

[L4D1 & L4D2] Ledge Release
 
1 Attachment(s)
Description:
Allow you to release by your own with (JUMP), (CROUCH) or (USE) key when you grabbed the ledge.
Plugin is based on:
- "Incapped Pills Pop" by AtomicStryker (fork by Dragokas)
- "L4D Ledge Release" by AltPluzF4, maintained by Madcap
Difference:
- Works stable.
- Less CPU usage.
- More safe checks.
- Ugly hang music stop.
- More options.
Settings (ConVars):

Located at /cfg/sourcemod/l4d_ledge_release.cfg
PHP Code:

// Enable this plugin (1 - Yes, 2 - No)
l4d_ledge_release_enable "1"

// How long before grabbing the ledge you can release
l4d_ledge_release_delaytime "1.0"

// 0 - Disable, 1 - Enable survivor hp penalty for hanging too long on a ledge
l4d_ledge_release_use_penalty "1"

// What button to press for release? 2 - Jump, 4 - Duck, 32 - Use. You can combine
l4d_ledge_release_button "4"

// What messages to display? -1 - All, 1 - Advertisements, 2 - Warnings
l4d_ledge_release_msg_level "-1" 

Requirements:
- SourceMod 1.10+
- DHooks Detours v.2.2.0.15+
Translations
- English
- Russian
Compatibility
- L4D1
- L4D2
Credits:
- Re:Creator, Lux, BHaType, Silvers - for various methods suggested to stop the music.
Related plugins:
- [L4D1] Health Exploit Fix by Dragokas
- [L4D1 & L4D2] Incapped Pills Pop by Dragokas
- [L4D, L4D2] No Death Check Until Dead by chinagreenelvis
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money

Lux 05-26-2019 13:31

Re: [L4D] Ledge Release v2
 
This will not really work.

PHP Code:

public void OnNextFrame(any client)
{
    if (!
IsClientInGame(client))
        return;
    
    
ClientCommand(client"music_dynamic_stop_playing Event.LedgeHangTwoHands");
    
ClientCommand(client"music_dynamic_stop_playing Event.LedgeHangOneHand");
    
ClientCommand(client"music_dynamic_stop_playing Event.LedgeHangFingers");
    
ClientCommand(client"music_dynamic_stop_playing Event.LedgeHangAboutToFall");
    
ClientCommand(client"music_dynamic_stop_playing Event.LedgeHangFalling");
    
    
StopSound(clientSNDCHAN_STATIC"music/terror/ClingingToHell1.wav");
    
StopSound(clientSNDCHAN_STATIC"music/terror/ClingingToHell2.wav");
    
StopSound(clientSNDCHAN_STATIC"music/terror/ClingingToHell3.wav");
    
StopSound(clientSNDCHAN_STATIC"music/terror/ClingingToHell4.wav");


You wanna use the give health command so engine dispatches to the music system to stop the music.

or you can use a sdkcall to Music::Stop().
which sends a usermessage to client.

Dragokas 05-26-2019 15:22

Re: [L4D] Ledge Release v2
 
Thank you, Lux.

BHaType 05-27-2019 00:04

Re: [L4D] Ledge Release v2
 
PHP Code:

Music::StopMusic(Music *this, const char *, floatbool)
\
x55\x8B\xEC\x8B\x45\x10\xD9\x45\x0C\x8B\x55\x08 


Silvers 05-27-2019 08:26

Re: [L4D] Ledge Release v2
 
Quote:

Originally Posted by BHaType (Post 2653238)
PHP Code:

Music::StopMusic(Music *this, const char *, floatbool)
\
x55\x8B\xEC\x8B\x45\x10\xD9\x45\x0C\x8B\x55\x08 



This function is called by: sv_stop_music <name of gamesound music> which sends the usermessage "MusicCmd" to stop. This sigs for L4D2 only. Suprised it doesn't break without wildcard compared to 2017 binary.

Lux 05-31-2019 11:28

Re: [L4D] Ledge Release v2
 
Quote:

Originally Posted by Silvers (Post 2653269)
This function is called by: sv_stop_music <name of gamesound music> which sends the usermessage "MusicCmd" to stop. This sigs for L4D2 only. Suprised it doesn't break without wildcard compared to 2017 binary.

I'm not sure if sv_stop_music will dispatch it to everyone, if so you may need to hook MusicCmd usermessage and strip away all other clients if you use that method maybe.

Dragokas 01-21-2020 14:10

Re: [L4D] Ledge Release v2
 
Updated.

Quote:

2.3 (23-Nov-2019)
- Fixed infinite hanging sound.
- Now, correctly set health (compatible with my "Health Exploit Fix" plugin) and fire appropriate event.

xZk 01-21-2020 14:43

Re: [L4D] Ledge Release v2
 
great!, a suggestion could you add some cmd to release, or a cvar to edit the default key

Dragokas 01-21-2020 14:51

Re: [L4D] Ledge Release v2
 
why? Usually players get hang when they try to jump next to the cliff. They are jumping using 'Space' key, so logically the can use the same key to continue jump if they get hang.

if you request I can add, if it is just suggestion, I see if anybody else comment about the need to change default key.

xZk 01-21-2020 16:26

Re: [L4D] Ledge Release v2
 
1 Attachment(s)
fail i'm sorry, it was a request, I still have to improve my English xd.
I tested this on l4d2 and i have a bug: the survivor does not restore your hp correctly
https://imgur.com/a/vVGHEe0
edit:
I think that now I realize that this restoration was necessary to avoid losing a lot of hp or killing yourself when released xd. I will leave this alternative version for L4D2, in case someone else doesn't like that


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

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