RoadRageRR Posted June 4, 2013 Share Posted June 4, 2013 Ok, so I found a cool helicopter and it has 2 .ddf's (1 with the landing gear in and 1 with landing gear out), and I was wondering if it is possible to change the texture of it in mid game/flight? (all I need is the command line) I have this so far.... local textureIn = 1 local textureOut = 0 function setTexture( key ) if key == "0" then if textureOut == 0 then textureOut = textureOut + 1 textureIn = textureIn - 1 -->make texture change... end elseif key == "9" then if textureIn == 0 then textureIn = playerGear + 1 textureOut = playerGear - 1 --->make texture change... end end end What would I need to fill in the comment lines? Link to comment
MIKI785 Posted June 4, 2013 Share Posted June 4, 2013 Use the engine functions, https://wiki.multitheftauto.com/wiki/Cl ... _functions There are examples of what you need. Link to comment
RoadRageRR Posted June 4, 2013 Author Share Posted June 4, 2013 Use the engine functions, https://wiki.multitheftauto.com/wiki/Cl ... _functionsThere are examples of what you need. Ok thanks, but I am in need of just a little more assistance... I am not sure how to bind keys... I know just enough to get errors... How do I make an alternating key? (I.E. when I press it once it changes the texture, and when I press it again it changes back) Thanks! skinchange.lua local textureIn = 1 local textureOut = 0 function setTexture( key ) if key == "0" then if textureOut == 0 then textureOut = textureOut + 1 textureIn = textureIn - 1 dff = engineLoadDFF ( "geardown/hunter.dff", 425 ) engineReplaceModel ( dff, 425 ) -->make texture change... end elseif key == "9" then if textureIn == 0 then textureIn = playerGear + 1 textureOut = playerGear - 1 dff = engineLoadDFF ( "gearup/hunter.dff", 425 ) engineReplaceModel ( dff, 425 ) --->make texture change... end end end bindKey( "0", "up", setTexture ) bindKey( "9", "up", setTexture ) Link to comment
RoadRageRR Posted June 9, 2013 Author Share Posted June 9, 2013 bump? I don't think this should be hard, I just need a couple more lines I think... Thanks! Link to comment
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