This is a free educational resource that demonstrates how to load and manipulate water at runtime within FiveM. This means you no longer need to modify gta5.meta or restart your server to see changes.
Included are commands to load, reset, and flood the map within GTA5.
Included in the files are suggestions that could be made to further enhance the experience, such as changing the weather to rain/thunder, disabling artificial lights, and changing the WaveQuad amplitude for larger waves and swell.
The code in this repository represents the same “flooding” / “tsunami” which was demonstrated by Nikez a few months back, and is probably the same approach used for flooding the sewers / tunnels in NoPixel 4.0
DW, Iv reached out too him and wanna work on something to do this. As i already have an emailing alert system script already and think this would be great addition too the script! Tsunami Restart
There’s no easy way to handle this other than trial and error for each of the WaterQuads. Take note that if you only have a single WaterQuad defined in the xml file, the game engine will slice that up in to smaller chunks.
You can see how many WaterQuads are active with the following:
local waterQuadCount = GetWaterQuadCount()
print(waterQuadCount)
For each of the WaterQuads that are having rendering issues, you can try modifying the Type attribute to one of these values.
For some reason it will not let me swim in the water? is this an intentional feature or is there something I’m doing wrong and is there any way to fix/change it.
I’ve noticied this happening occasionally as well (for players & peds), from what I’ve seen it seems to be a problem with the game engine failing to detect that you are underwater. Sometimes getting in and out of a vehicle can trigger the engine to correctly detect that you are underwater.
Some ideas which may help that you could try:
Use smaller WaterQuads, don’t cover the entire map.
Reduce the rate at which the WaterQuad height changes.
Compare the peds z with the height of the WaterQuads z, if lower try setting SetPedMaxTimeInWater(ped, duration) ??
I’ve just pushed a quick fix to force peds & players to be in a swimming state if they are within a WaterQuad, and their Z value is less than that of the WaterQuad … aka they are underwater. It’s not the nicest of solutions but it does work.