Jump to content

[help] Bad argument setPedAnimation


#RooTs

Recommended Posts

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

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

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

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