Cynoq Posted December 21, 2015 Share Posted December 21, 2015 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
Addlibs Posted December 21, 2015 Share Posted December 21, 2015 Which version of DayZ are you using? The new open-source version or the older one? Link to comment
Cynoq Posted December 21, 2015 Author Share Posted December 21, 2015 Which version of DayZ are you using? The new open-source version or the older one? 0.6 Nighlty I think it is Link to comment
MTA Team 0xCiBeR Posted December 22, 2015 MTA Team Share Posted December 22, 2015 That version is closed-source and does have a bug animation. You should use new open source version: https://github.com/mtadayz/MTADayZ Link to comment
Tekken Posted December 22, 2015 Share Posted December 22, 2015 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. Link to comment
1LoL1 Posted December 22, 2015 Share Posted December 22, 2015 Use this on medic and use this on all setPedAnimation. function onPlayerUseMedicObject(itemName) local playersource = source setPedAnimation(playersource, "BOMBER", "BOM_Plant", -1, false, false, nil, false) Link to comment
Cynoq Posted December 22, 2015 Author Share Posted December 22, 2015 That version is closed-source and does have a bug animation. You should use new open source version: https://github.com/mtadayz/MTADayZ I tried using this but it was very buggy and didn't load textures, and has a lot of things I do not want in DayZ. Link to comment
Cynoq Posted December 22, 2015 Author Share Posted December 22, 2015 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
1LoL1 Posted December 22, 2015 Share Posted December 22, 2015 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
Cynoq Posted December 22, 2015 Author Share Posted December 22, 2015 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
1LoL1 Posted December 22, 2015 Share Posted December 22, 2015 Client-Side is "client.lua" or find in meta.xml. Link to comment
Cynoq Posted December 23, 2015 Author Share Posted December 23, 2015 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! Link to comment
1LoL1 Posted December 23, 2015 Share Posted December 23, 2015 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! You're welcome. Link to comment
Cynoq Posted December 23, 2015 Author Share Posted December 23, 2015 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! You're welcome. 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
Tekken Posted December 23, 2015 Share Posted December 23, 2015 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
Cynoq Posted December 24, 2015 Author Share Posted December 24, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now