-.Paradox.- Posted June 24, 2013 Posted June 24, 2013 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
Castillo Posted June 24, 2013 Posted June 24, 2013 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.
-.Paradox.- Posted June 24, 2013 Author Posted June 24, 2013 Thanks, and can i add one more skin id 45 walking style 118 ?
iMr.3a[Z]eF Posted June 24, 2013 Posted June 24, 2013 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 ) )
-.Paradox.- Posted June 24, 2013 Author Posted June 24, 2013 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
Castillo Posted June 24, 2013 Posted June 24, 2013 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 )
-.Paradox.- Posted June 24, 2013 Author Posted June 24, 2013 thanks it work fine You are the best Castillo
ixjf Posted June 24, 2013 Posted June 24, 2013 Having a couple of if/elseif-statements is pointless. local theModel = ( ( newModel == 132 ) and 10 ) or ( ( newModel == 118 ) and 45 ) or 0 setPedWalkingStyle( source, theModel )
Castillo Posted June 24, 2013 Posted June 24, 2013 Well, I gave him one method, which would be easier to understand to him. He also could have used tables.
-.Paradox.- Posted June 25, 2013 Author Posted June 25, 2013 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
Castillo Posted June 25, 2013 Posted June 25, 2013 local skins = { [ 132 ] = 10, [ 118 ] = 45 } addEventHandler ( "onElementModelChange", root, function ( _, newModel ) setPedWalkingStyle ( source, skins [ newModel ] or 0 ) end ) Try it.
-.Paradox.- Posted June 26, 2013 Author Posted June 26, 2013 when i set skin it show walking style but in a few seconds it get removed
Castillo Posted June 26, 2013 Posted June 26, 2013 Well, that's strange... maybe you have an script reseting it.
Castillo Posted June 27, 2013 Posted June 27, 2013 I've tested it on my server and setPedWalkingStyle is always returning 'false'.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now