#RooTs Posted January 18, 2016 Share Posted January 18, 2016 I want to remove the animation setPedAnimation ( target, "ped", "IDLE_tired", 200 ) after 5 seconds addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired", 200 ) setTimer ( function(target) setPedAnimation(target) end, 5000, 1 ) setElementData(target, "tired", false) triggerClientEvent(target, "sayInformation", root, "en", "You can go now.") end) Link to comment
Mr.Loki Posted January 18, 2016 Share Posted January 18, 2016 try this addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,target) setElementData(target, "tired", false) triggerClientEvent(target, "sayInformation", root, "en", "You can go now.") end) Link to comment
#RooTs Posted January 18, 2016 Author Share Posted January 18, 2016 try this addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,target) setElementData(target, "tired", false) triggerClientEvent(target, "sayInformation", root, "en", "You can go now.") end) no work Link to comment
Mr.Loki Posted January 18, 2016 Share Posted January 18, 2016 ok then this should work addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) ped = target setPedAnimation ( ped, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,ped) setElementData(ped, "tired", false) triggerClientEvent(ped, "sayInformation", root, "en", "You can go now.") end) Link to comment
#RooTs Posted January 18, 2016 Author Share Posted January 18, 2016 ok then this should work addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) ped = target setPedAnimation ( ped, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,ped) setElementData(ped, "tired", false) triggerClientEvent(ped, "sayInformation", root, "en", "You can go now.") end) no work, without error in the debug Link to comment
Mr.Loki Posted January 18, 2016 Share Posted January 18, 2016 change: setPedAnimation ( player, "ped", "IDLE_tired", 200 ) to : setPedAnimation ( player, "ped", "IDLE_tired" ) Link to comment
#RooTs Posted January 18, 2016 Author Share Posted January 18, 2016 change: setPedAnimation ( player, "ped", "IDLE_tired", 200 )to : setPedAnimation ( player, "ped", "IDLE_tired" ) my code is serverSide. the pre-defined "player" variable is clientSide Link to comment
Mr.Loki Posted January 18, 2016 Share Posted January 18, 2016 oops i meant just remove the 4th arg in setPedAnimation sorry i was testing it Link to comment
#RooTs Posted January 18, 2016 Author Share Posted January 18, 2016 oops i meant just remove the 4th arg in setPedAnimation sorry i was testing it worked, thanks addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired" ) setTimer ( function(target) setPedAnimation(target) end, 5000, 1, target ) setElementData(target, "tired", false) end) 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