-.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 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.
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted June 24, 2013 Author Posted June 24, 2013 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.
Castillo Posted June 24, 2013 Posted June 24, 2013 Yes, you can use 'elseif' statements for that. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) ) To Visit Us Press Here: mtasa://5.9.206.180:22002
-.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 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.
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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted June 24, 2013 Author Posted June 24, 2013 thanks it work fine 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.
Castillo Posted June 24, 2013 Posted June 24, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.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 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.
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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted June 25, 2013 Author Posted June 25, 2013 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.
-.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 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.
Castillo Posted June 26, 2013 Posted June 26, 2013 Well, that's strange... maybe you have an script reseting it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted June 27, 2013 Author Posted June 27, 2013 no i dont have 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.
Castillo Posted June 27, 2013 Posted June 27, 2013 I've tested it on my server and setPedWalkingStyle is always returning 'false'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
-.Paradox.- Posted June 27, 2013 Author Posted June 27, 2013 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.
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