Rezox
Member
- Joined
- Apr 18, 2021
- Messages
- 310
- Reaction score
- 156,335
- Points
- 401
Hello vag world today I would like to share a very nice post with you;
While browsing the forums, a nice catch caught my eye and I wanted to make a wish.
The feature of the plugin;
After running for a certain time, the character enters the breathing animation.
When we look at it, it is a simple client code, if you wish, you can paste the codes into any client file of your own server.
While browsing the forums, a nice catch caught my eye and I wanted to make a wish.
After running for a certain time, the character enters the breathing animation.
When we look at it, it is a simple client code, if you wish, you can paste the codes into any client file of your own server.
Java:
local isSprinting, isSwimming, isUnderwater = false, false, false
Citizen.CreateThread(function()
while true do
Citizen.Wait(100) -- check every 100 ticks, performance matters
local letSleep = true
local stamina = GetPlayerSprintStaminaRemaining(PlayerId())
if isSprinting then
letSleep = false
if stamina == 100 then
if not isSwimming and not isUnderwater then
RequestAnimDict("re@construction")
while not HasAnimDictLoaded("re@construction") do
Citizen.Wait(100)
end
TaskPlayAnim(PlayerPedId(), "re@construction", "out_of_breath", 8.0, 8.0,-1, 32, 0, false, false, false)
end
end
end
if letSleep then
Citizen.Wait(500)
end
end
end)
Citizen.CreateThread(function()
while true do
local lPed = GetPlayerPed(-1)
isSprinting = IsPedSprinting(lPed)
isSwimming = IsPedSwimming(lPed)
isUnderwater = IsPedSwimmingUnderWater(lPed)
Citizen.Wait(500)
end
end)
Hidden link for visitors, to see
Log in or register now.