Jump to content

Anyone here experienced with MTA DayZ?


Cynoq

Recommended Posts

I am having a glitch with my server, which is pretty much game breaking. I am not very experienced with lua so I cannot not locate the problem. In dayz you survive by drinking water, eating food right? Well essentially whenever a player eats, drinks, blood bags, medkits etc there is a player animation that plays for about 3 seconds, but the problem I am having is the animation won't stop. If anyone has any idea how to fix this a comment would be greatly appreciated. Thanks in advance!

Link to comment
Use this Client-Side:
setTimer(function() 
    Anim,_ = getPedAnimation(getLocalPlayer()); 
    if (Anim) then 
        setPedAnimation(getLocalPlayer(), false); 
    end 
end, 2000, 0); 

You may change the timer duration to catch the animation.

I'm new to this. Where would I put this code exactly? Thanks for the help.

Link to comment
Use this Client-Side:
setTimer(function() 
    Anim,_ = getPedAnimation(getLocalPlayer()); 
    if (Anim) then 
        setPedAnimation(getLocalPlayer(), false); 
    end 
end, 2000, 0); 

You may change the timer duration to catch the animation.

I'm new to this. Where would I put this code exactly? Thanks for the help.

In client-side.

Link to comment
Use this Client-Side:
setTimer(function() 
    Anim,_ = getPedAnimation(getLocalPlayer()); 
    if (Anim) then 
        setPedAnimation(getLocalPlayer(), false); 
    end 
end, 2000, 0); 

You may change the timer duration to catch the animation.

I'm new to this. Where would I put this code exactly? Thanks for the help.

In client-side.

Can't find "client-side"

Link to comment
Client-Side is "client.lua" or find in meta.xml.

You fixed it! You are a life saver man! I wish I could thank you more! Thank you! :mrgreen:

You're welcome. :lol:

Hey I noticed something about that code. It stops all animations after 2 seconds.

Do you know a way to only stop a certain animation?

Link to comment
Hey I noticed something about that code. It stops all animations after 2 seconds.

Do you know a way to only stop a certain animation?

Using this:

local blockAnims = { 
    "BOM_Plant", 
    }; -- You will have to do others by yourself! 
  
setTimer(function() 
    Block, AnimationName = getPedAnimation(getLocalPlayer()); 
    for _,v in ipairs(blockAnims) do 
        if (AnimationName == v) then 
            setPedAnimation(getLocalPlayer(), false); 
        end 
    end 
end, 2000, 0); 

Link to comment
Hey I noticed something about that code. It stops all animations after 2 seconds.

Do you know a way to only stop a certain animation?

Using this:

local blockAnims = { 
    "BOM_Plant", 
    }; -- You will have to do others by yourself! 
  
setTimer(function() 
    Block, AnimationName = getPedAnimation(getLocalPlayer()); 
    for _,v in ipairs(blockAnims) do 
        if (AnimationName == v) then 
            setPedAnimation(getLocalPlayer(), false); 
        end 
    end 
end, 2000, 0); 

Found the other animations I needed and the problem is fixed, all thanks to you. Thanks for everything man!

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...