Jump to content

Problem with setPedanimation


Hawkster

Recommended Posts

Sup People,

I've made a script, which SHOULD create a ped and let em do their animation, but they are only standing, so they not doing what they should do.

Here is the code:

addEventHandler("onResourceStart", resourceRoot, function() 
    local ped = createPed(106, 2479.3000488281, -1653.1999511719, 13.5, 90, 0, 0)  
    setElementFrozen(ped, true) 
    setPedAnimation(ped, "GANGS", "smkcig_prtl", -1, true, true, false) 
end) 

There are no errors.

Link to comment
addEventHandler("onResourceStart", resourceRoot, function() 
    local ped = createPed(106, 2479.3000488281, -1653.1999511719, 13.5, 90, 0, 0)  
        setTimer (  
            function  ( ) 
                if isElement ( ped ) then 
                    setElementFrozen(ped, true) 
                    setPedAnimation(ped, "GANGS", "smkcig_prtl", -1, true, true, false) 
        end 
    end,100,1 
    ) 
end 
) 

Use a timer because the ped maybe not created yet try this and tell me the results .

Link to comment

-- # Client Side : 
  
addEventHandler('onClientPedDamage',root, 
    function (      ) 
        for _,ped in ipairs ( getElementsByType ( 'ped',resourceRoot ) ) do 
            if source == ped then 
                cancelEvent (   ) 
        end 
    end 
end 
) 

Remember it's a client side .

Link to comment

It's fine to think about that. Learning a programming language may take hours (or even minutes, if you're only after the basics). If you have some programming experience, learning new languages is easy.

To learn Lua you can read this manual: http://www.lua.org/manual/5.1/ . The "Language" section describes the syntax and the features and the "Standard Libraries" section documents functions which come with Lua. If you are experienced enough in programming, you will be able to learn it fast.

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