warlitsh Posted July 18, 2013 Share Posted July 18, 2013 Hi , I need help. I can replace the car with: function Model() txd = engineLoadTXD("name.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("name.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), Model) But I try to have the original car + Change car. how to do this? (Sorry for my bad english...) Thx for help. Link to comment
Castillo Posted July 18, 2013 Share Posted July 18, 2013 You can't have the original and the mod. Link to comment
warlitsh Posted July 18, 2013 Author Share Posted July 18, 2013 even with "control" (Example : /Newcar ) for activate ? Link to comment
Castillo Posted July 18, 2013 Share Posted July 18, 2013 You can't have them at the same time, but you can desactivate/activate with commands, etc. Link to comment
-.Paradox.- Posted July 18, 2013 Share Posted July 18, 2013 (edited) function newcar() txd = engineLoadTXD("name.txd", 411 ) engineImportTXD(dff, 411) dff = engineLoadDFF("name.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), newcar) addCommandHandler ( "newcar", newcar ) Edited July 18, 2013 by Guest Link to comment
xXMADEXx Posted July 18, 2013 Share Posted July 18, 2013 You can try this, but i havn't tested it. local isCarModEnabled = false function newcar ( ) if not isCarModEnabled then local txd = engineLoadTXD("name.txd", id ) engineImportTXD(dff, id) local dff = engineLoadDFF("name.dff", id ) engineReplaceModel(dff, id) isCarModEnabled = true else engineRestoreModel ( id ) isCarModEnabled = false end end addCommandHandler ( "newcar", newcar ) Link to comment
-.Paradox.- Posted July 18, 2013 Share Posted July 18, 2013 You can try this, but i havn't tested it. local isCarModEnabled = false function newcar ( ) if not isCarModEnabled then local txd = engineLoadTXD("name.txd", id ) engineImportTXD(dff, id) local dff = engineLoadDFF("name.dff", id ) engineReplaceModel(dff, id) isCarModEnabled = true else engineRestoreModel ( id ) isCarModEnabled = false end end addCommandHandler ( "newcar", newcar ) Both are working. x) Link to comment
codeluaeveryday Posted July 18, 2013 Share Posted July 18, 2013 Remember to define the id or just replace it. Link to comment
xXMADEXx Posted July 18, 2013 Share Posted July 18, 2013 You can try this, but i havn't tested it. local isCarModEnabled = false function newcar ( ) if not isCarModEnabled then local txd = engineLoadTXD("name.txd", id ) engineImportTXD(dff, id) local dff = engineLoadDFF("name.dff", id ) engineReplaceModel(dff, id) isCarModEnabled = true else engineRestoreModel ( id ) isCarModEnabled = false end end addCommandHandler ( "newcar", newcar ) Both are working. x) lolz, then why not post the correct one? Link to comment
-.Paradox.- Posted July 18, 2013 Share Posted July 18, 2013 I used his code. x) I guess yours better. Link to comment
warlitsh Posted July 18, 2013 Author Share Posted July 18, 2013 You can try this, but i havn't tested it. local isCarModEnabled = false function newcar ( ) if not isCarModEnabled then local txd = engineLoadTXD("name.txd", id ) engineImportTXD(dff, id) local dff = engineLoadDFF("name.dff", id ) engineReplaceModel(dff, id) isCarModEnabled = true else engineRestoreModel ( id ) isCarModEnabled = false end end addCommandHandler ( "newcar", newcar ) Thanks you ! Is perfect for my server ! Sorry I debuted in script I'll add you to the credit of my server! Link to comment
xXMADEXx Posted July 18, 2013 Share Posted July 18, 2013 You can try this, but i havn't tested it. local isCarModEnabled = false function newcar ( ) if not isCarModEnabled then local txd = engineLoadTXD("name.txd", id ) engineImportTXD(dff, id) local dff = engineLoadDFF("name.dff", id ) engineReplaceModel(dff, id) isCarModEnabled = true else engineRestoreModel ( id ) isCarModEnabled = false end end addCommandHandler ( "newcar", newcar ) Thanks you ! Is perfect for my server ! Sorry I debuted in script I'll add you to the credit of my server! No problem. 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