Raised This Month: $ Target: $400
 0% 

Water extinguishing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
3ipKa
Member
Join Date: Jul 2013
Location: Western Siberia
Old 03-09-2021 , 11:20   Water extinguishing
Reply With Quote #1

Hi, folks! Question is related to l4d2 game, by the way. Is there any way to make the water not to extinguish player? Maybe there are some water properties or engine function that can be patched? I assume, it can be done by using hooks, ignition and so on, but it's a bit tricky and complicated way...
Was trying to find same topic or something similar, but faild to.
3ipKa is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-10-2021 , 06:48   Re: Water extinguishing
Reply With Quote #2

You can detour the "CTerrorPlayer::Extinguish" function with DHooks and block it when the player is in the water.

Be warned that the detour will be fired wayyy too often while the player is in the water because it's constantly checking if the player should be extinguished. When it's just firing for one player, there's no difference in performance, but I'm not entirely sure if you can say the same with multiple burning players in the water.

Anyway, here's a small plugin using the method I mentioned above, and the necessary gamedata info. Both L4D games are supported.

I'm sure you can just patch the function to return early, but I'm not sure when to patch it exactly since I can't find a function that fires when a player enters/exits the water.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_inextinguishable_players.sp - 24 views - 1.2 KB)
File Type: txt l4d_inextinguishable_players.txt (801 Bytes, 25 views)
__________________
Psyk0tik is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-16-2021 , 13:20   Re: Water extinguishing
Reply With Quote #3

Quote:
Originally Posted by Crasher_3637 View Post
I'm sure you can just patch the function to return early, but I'm not sure when to patch it exactly since I can't find a function that fires when a player enters/exits the water.
I guess, it must be one of those calls in: CBasePlayer::WaterMove or CBasePlayer::UpdateUnderwaterState
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
3ipKa
Member
Join Date: Jul 2013
Location: Western Siberia
Old 03-17-2021 , 07:45   Re: Water extinguishing
Reply With Quote #4

Crasher, Thank You I think it'll do the trick. I'm sorry for late response.
Thank you guys!
3ipKa is offline
Reply



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 03:29.


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