Jump to content
  • 0

Walking style (need help!)


Soultaker17

Question

Hello! Our team is working on machinima project. So we are ready to start but one problem. Men and women have same walking style animations and it looks abnormal. I tried to solve this problem by creating a script and it works. I can see that animation changed but other players don't see that. It's a big problem for us and we really need help. How can I change walking style for all players on server?

P.S. Sorry for my bad english

Link to comment

7 answers to this question

Recommended Posts

  • 0
Use it server side instead of client.

How can I do it? I'm newbie in scripting.

Now I have resource with a .lua script inside with this code

addCommandHandler ( "drunk", 
    function ( player ) 
        setPedWalkingStyle ( player, 126 ) 
    end 
) 

I installed this resource into "MTA San Andreas\server\mods\deathmatch\resources" folder

And It works. When I type "/drunk" in chat my animation changes but other players can't see it. How can I fix it?

Link to comment
  • 0
  • MTA Team

It seems this is a bug for players joining after you have set the walking style.

A hacky work around would be:

Server:

addCommandHandler ( "drunk", 
    function ( player ) 
        setPedWalkingStyle ( player, 126 ) 
        setElementData( player, "walking_style_hack", 126 ) 
    end 
) 

Client:

addEventHandler ( "onClientResourceStart", resourceRoot, 
    function () 
        for _,player in ipairs( getElementsByType("player") ) do 
            local style = getElementData( player, "walking_style_hack" ) 
            if style then 
                setPedWalkingStyle ( player, style ) 
            end 
        end      
    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...