Jump to content

[help] Bad argument setPedAnimation


#RooTs

Recommended Posts

Posted

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) 

Posted

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) 

Posted
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

Posted

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) 

Posted
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 :(

Posted
change: setPedAnimation ( player, "ped", "IDLE_tired", 200 )

to : setPedAnimation ( player, "ped", "IDLE_tired" )

my code is serverSide. the pre-defined "player" variable is clientSide :?

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

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