Jump to content

Walking Style


Recommended Posts

Posted

Hello,

I need a resource that if player skin id is 10 his walking style set to 132,

i have this resource but i want it without command i mean work automatically

addCommandHandler ("s", 
function ( ped ) 
    setPedWalkingStyle  ( 10, 132) 
end 
) 

Thanks for helping

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

This will set it when your skin changes.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thanks, and can i add one more skin id 45 walking style 118 ?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Yes, you can use 'elseif' statements for that.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

This will set it when your skin changes.

he want to set the walking style whem he write on console "s"

addEventHandler ( "onElementModelChange", root, 
addCommandHandler ( "s",  
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 
) 
  

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
        elseif ( newModel == 118 ) then 
            setPedWalkingStyle ( source, 45 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

like that

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

This will set it when your skin changes.

he want to set the walking style whem he write on console "s"

addEventHandler ( "onElementModelChange", root, 
addCommandHandler ( "s",  
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 
) 
  

Would you please read the topic?

i have this resource but i want it without command i mean work automatically

@Mr.X001:

addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        elseif ( newModel == 118 ) then 
            setPedWalkingStyle ( source, 45 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

thanks :) it work fine :D You are the best Castillo

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Well, I gave him one method, which would be easier to understand to him.

He also could have used tables.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

when i use on

addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

It works but when i add

addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        if ( newModel == 132 ) then 
            setPedWalkingStyle ( source, 10 ) 
        elseif ( newModel == 118 ) then 
            setPedWalkingStyle ( source, 45 ) 
        else 
            setPedWalkingStyle  ( source, 0 ) 
        end 
    end 
) 

Dont work

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
local skins = 
    { 
        [ 132 ] = 10, 
        [ 118 ] = 45 
    } 
  
addEventHandler ( "onElementModelChange", root, 
    function ( _, newModel ) 
        setPedWalkingStyle ( source, skins [ newModel ] or 0 ) 
    end 
) 

Try it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ok

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

when i set skin it show walking style but in a few seconds it get removed

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Well, that's strange... maybe you have an script reseting it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

no i dont have :P

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

I've tested it on my server and setPedWalkingStyle is always returning 'false'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

So what's the problem ? :(

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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