Jump to content

A question.


mcer

Recommended Posts

You don't have to use anything else but setPedAnimation to make it repeat, just set the repeat argument.

See the code

function playerDamagehelp() 
local getdamage = getElementHealth ( getLocalPlayer() ) 
if getdamage < 21 then 
local playeranimdamage = getLocalPlayer() 
setPedAnimation( playeranimdamage, "beach", "bather") 
else 
local playeranimdamages = getLocalPlayer() 
setPedAnimation(playeranimdamages,false) 
end 
end 
addEventHandler("onClientRender", getRootElement(), playerDamagehelp) 

Link to comment
setPedAnimation ( playeranimdamage, "beach", "bather", -1, true ) 

Use that instead.

Same problem.

Repeat in less than a second, is not expected until the end of the animation.

The loop argument will repeat it after it ended.

I know, but i have this problem with or without "true"

Link to comment
addEventHandler('onClientResourceStart',resourceRoot, 
 function (     ) 
  setTimer ( 
    function  (  )  
        local anim = {getPedAnimation( localPlayer )} 
            if getElementHealth ( localPlayer ) <= 20 then 
            if not ( anim[1] == "beach" and anim[2] =="bather" ) then 
            setPedAnimation ( localPlayer, "beach", "bather", -1, true, true, false ) 
        end  
   else 
        if ( anim[1] == "beach" and anim[2] == "bather" ) then 
        setPedAnimation( localPlayer, false) 
            end  
        end 
     end,500,0 
  ) 
 end 
) 

Try this.

Link to comment
addEventHandler('onClientResourceStart',resourceRoot, 
 function (     ) 
  setTimer ( 
    function  (  )  
        local anim = {getPedAnimation( localPlayer )} 
            if getElementHealth ( localPlayer ) <= 20 then 
            if not ( anim[1] == "beach" and anim[2] =="bather" ) then 
            setPedAnimation ( localPlayer, "beach", "bather", -1, true, true, false ) 
        end  
   else 
        if ( anim[1] == "beach" and anim[2] == "bather" ) then 
        setPedAnimation( localPlayer, false) 
            end  
        end 
     end,500,0 
  ) 
 end 
) 

Try this.

Worked!!, Thanks! :D

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...