Jump to content

Problem with setPedanimation


Hawkster

Recommended Posts

Posted

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.

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

Posted

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

Posted

I need you help again :)

How can I freeze,lock and make it undestroyable ?

Code:

createVehicle ( 567, 2479.8999023438, -1655.4000244141, 13.300000190735, 0, 0, 90.25, 6, 0, 0, 0, 0 ) -- Savanna 
  

Posted

I've read this articles, but they only show me, how to freeze the car, while the player is sitting in it.

It don't work when nobody is in it.

Posted

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.

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