#RooTs Posted January 18, 2016 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)
Mr.Loki Posted January 18, 2016 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)
#RooTs Posted January 18, 2016 Author 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
Mr.Loki Posted January 18, 2016 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)
#RooTs Posted January 18, 2016 Author 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
Mr.Loki Posted January 18, 2016 Posted January 18, 2016 change: setPedAnimation ( player, "ped", "IDLE_tired", 200 ) to : setPedAnimation ( player, "ped", "IDLE_tired" )
#RooTs Posted January 18, 2016 Author 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
Mr.Loki Posted January 18, 2016 Posted January 18, 2016 oops i meant just remove the 4th arg in setPedAnimation sorry i was testing it
#RooTs Posted January 18, 2016 Author 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)
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