razvan2299 Posted January 30, 2014 Posted January 30, 2014 Hi! I need some help! I wanna install some weapon skins to my mta server.PLEASE HELP ME!!I have the dff and txd file.!!
Karuzo Posted January 30, 2014 Posted January 30, 2014 lol calm down , function applyMods() local skin = engineLoadTXD("m4.txd", true) engineImportTXD(skin, 356) local skin = engineLoadDFF("m4.dff", 356) engineReplaceModel(skin, 356) end addEventHandler("onClientResourceStart", resourceRoot, applyMods)
undefined Posted January 30, 2014 Posted January 30, 2014 function mods() local txd = engineLoadTXD ('(yourfile.txd)') engineImportTXD(txd,(weapon - skin - vehicle, object ID) local dff = engineLoadDFF('(yourfile.dff)') engineReplaceModel(dff,weapon - skin - vehicle, object ID) local col = engineLoadCol('(yourfile.col)') engineReplaceModel(col,object ID) end addEventHandler('onClientResourceStart',getResourceRootElement(getThisResource()),mods) Example function mods() local txd = engineLoadTXD ('files/1.txd') engineImportTXD(txd,56) local dff = engineLoadDFF('files/1.dff',56) engineReplaceModel(dff,56) end addEventHandler('onClientResourceStart',getResourceRootElement(getThisResource()),mods)
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 What I'm gonna do with the code? Give me an exemple for AK-47 please!!
Karuzo Posted January 30, 2014 Posted January 30, 2014 What don't you understand ? function applyMods() local skin = engineLoadTXD("ak47.txd", true) engineImportTXD(skin, 30) local skin = engineLoadDFF("ak47.dff", 30) engineReplaceModel(skin, 30) end addEventHandler("onClientResourceStart", resourceRoot, applyMods) meta:
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 @KRZO I did what you said but nothing...
Karuzo Posted January 30, 2014 Posted January 30, 2014 you're txd and dff are named ak47 ? your .lua is named scriptname.lua ? if not change it to your .lua in the meta.xml.
pa3ck Posted January 30, 2014 Posted January 30, 2014 <meta> <script src="scriptname.lua" /> <file src="ak47.txd" /> <file src="ak47.dff" /> </meta> Should be: <meta> <script src="scriptname.lua" type="client"/> <file src="ak47.txd" /> <file src="ak47.dff" /> </meta> If you don't define the type, it's automatically server-side.
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 So, I have the dff and the txd.What should I do next?Explain me step-by-step please!!
Karuzo Posted January 30, 2014 Posted January 30, 2014 oh ye pa3ck didn't noticed that , thanks you put them in one folder razvan , than you create a file called scriptname.lua , and put my code in that file. Than you create a meta.xml , and put that in what pa3ck write. Than you go on your server , type /refresh , and than /start resourcename (resourcename is the folder which you create so change it to your folder name). Hope it helps.
TAPL Posted January 30, 2014 Posted January 30, 2014 What don't you understand ? function applyMods() local skin = engineLoadTXD("ak47.txd", true) engineImportTXD(skin, 30) local skin = engineLoadDFF("ak47.dff", 30) engineReplaceModel(skin, 30) end addEventHandler("onClientResourceStart", resourceRoot, applyMods) meta: For replace txd or dff we use model id and not weapon id, so 30 won't work you need the model id and this can be found on the wiki. https://wiki.multitheftauto.com/wiki/Weapons Model ID for AK-47 is 355.
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 I did what you said.Now the resource is running, the ak-47 icon is changed but the weapon is still the same.
Karuzo Posted January 30, 2014 Posted January 30, 2014 What ? which ak-47 icon ? I thaught you wanted to change the weapon model ?
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 The weapon is not changed.The icon from the scroll menu is changed.
Karuzo Posted January 30, 2014 Posted January 30, 2014 And you have replaced the txd and the dff ? And put 355 instead of 30 ?
razvan2299 Posted January 30, 2014 Author Posted January 30, 2014 (edited) ERROE: DayZ/survivorSystem_client.lua_dayz1555: attempt to index field"?"(a nil value) EDIT: Silly me:)) I wrote 335 instead of 355 PROBLEM SOLVED Edited January 30, 2014 by Guest
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