[FilterScript] Southclaw's Underwater Swimming Fix - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Southclaw's Underwater Swimming Fix (
/showthread.php?tid=387157)
Southclaw's Underwater Swimming Fix -
[HLF]Southclaw - 23.10.2012
Southclaw's Underwater Swimming Fix
What?
Here's something I just made and tested, it's a small fix for something that's been annoying me for a long time!
Ever tried to swim through some underwater structure to find you get pushed up to the ceiling and get stuck? I have a custom level that contains some pipes that lead underwater and people get stuck down there and die all the time! I did a test and you get boosted up at a velocity of around 0.01715.
I just made this quickly to fix that problem, while you are underwater and you are looking either straight ahead or down your player will get a downwards (Z) velocity boost of 0.0026 to keep you at a constant depth.
Videos
A video comparison could probably better explain what this code does, but my main PC has a broken PSU and the one I'm using now can only just play SA:MP let alone record!
I'll add one as soon as my PC is fixed.
Download
Pastebin
(Requires y_timers)
Hope you like this script, any bugs please tell me and I will get to work fixing them
Re: Southclaw's Underwater Swimming Fix -
Lordzy - 23.10.2012
Sounds good.
Waiting for video..
Re: Southclaw's Underwater Swimming Fix - Glint - 23.10.2012
Wonderful though i didn't check it yet lol
Re: Southclaw's Underwater Swimming Fix -
Y_Less - 23.10.2012
Are you talking about that mystical phenomenon known as "floating"?
Re: Southclaw's Underwater Swimming Fix -
[HLF]Southclaw - 23.10.2012
Quote:
Originally Posted by Y_Less
Are you talking about that mystical phenomenon known as "floating"?
|
Yeah that one! It just annoyed me a lot, I'd rather do this than have it realistic and get me stuck on ceilings!
Re: Southclaw's Underwater Swimming Fix -
TheArcher - 23.10.2012
Isn't that better if you check gSwimmingDown in OnPlayerUpdate first then if is that true checking the animation index? I think it optimize a bit the performance, specially if you have more code in OnPlayerUpdate....Nice job though
Re: Southclaw's Underwater Swimming Fix -
[HLF]Southclaw - 23.10.2012
Good point! I did the animation check first then wrote the code for the camera angle checking so that explains why I didn't realise that at first, I'll change it now.
Re: Southclaw's Underwater Swimming Fix -
Excips - 23.10.2012
Great job, I will defiantly use this