Jump to content

Animation dont work


verona

Recommended Posts

Hi. Sorry for my bad english. I have 2 peds, an animations. Peds work, animations dont work. Why? I use Debugscript = clear.

function pedLoad ()
        ochrona = createPed ( 118, -791.09741210938, -2115.4497070313, 31 )
        babka = createPed ( 169, -794.55419921875, -2122.5825195313, 30.8 )
        setPedRotation ( babka, 90 )
        setPedRotation ( ochrona, 270 )
 
 
setPedAnimation(ochrona,"PED","Idle_Armed",-1,true,false,true)
setPedAnimation(babka,"SHOP","SHP_Serve_Loop",-1,true,false,true)
 
 
end
addEventHandler ( "onResourceStart", getRootElement(), pedLoad )

<meta>
   <script src="ochrona.lua" />
</meta>

Please help me.

for polish users:

Problem w tym ze pedy sie pojawiaja, lecz nie wykonuja zadnej animacji, a tylko stoja. Animacja ma byc wykonywana w petli, lecz pedy nie maja zmieniac swojej pozycji (stoja w moim mieszkaniu jako ochrona).

Link to comment

Replace:

setPedAnimation(ochrona,"PED","Idle_Armed",-1,true,false,true)
setPedAnimation(babka,"SHOP","SHP_Serve_Loop",-1,true,false,true)

with:

setTimer(setPedAnimation,500,1,ochrona,"PED","Idle_Armed",-1,true,false,true)
setTimer(setPedAnimation,500,1,babka,"SHOP","SHP_Serve_Loop",-1,true,false,true)

For some reasons peds can't take on stuff like animations at the time they're being created. So a small timer should do the trick.

P.S. If type is not specified, it defaults to being server-side. Frankly I don't see how it has anything to do with the issue at hand, anyway.

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