Turbe$Z Posted November 4, 2016 Share Posted November 4, 2016 function replaceModel() txd = engineLoadTXD("santa.txd", 290 ) engineImportTXD(txd, 290 ) dff = engineLoadDFF("santa.dff", 290 ) engineReplaceModel(dff, 290 ) txd = engineLoadTXD("male01.txd", 44 ) engineImportTXD(txd, 44 ) dff = engineLoadDFF("male01.dff", 44 ) engineReplaceModel(dff, 44 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( "reloadcar", replaceModel ) First skin (santa) is working fine, second (male01) got this error: Error loading DFF @ 'engineLoadDFF' [male01.dff] and bad argument @ engineReplaceModel [expected dff at argument 1, got boolean]... Wtf.. How to fix this? I do not understand this.. 1 Link to comment
MIKI785 Posted November 4, 2016 Share Posted November 4, 2016 male01.dff is either missing or corrupted. Link to comment
Turbe$Z Posted November 4, 2016 Author Share Posted November 4, 2016 26 minutes ago, MIKI785 said: male01.dff is either missing or corrupted. i tried another dff but doesn't working 1 Link to comment
#STZ Posted November 4, 2016 Share Posted November 4, 2016 function ReplaceModel() txd = engineLoadTXD ( "ID.txd" ) engineImportTXD ( txd, ID ) dff = engineLoadDFF ( "ID.dff", 0 ) engineReplaceModel ( dff, ID ) end addEventHandler("onClientResourceStart",resourceRoot, function () setTimer ( ReplaceModel, 300, 1) end) Dont Forget To Change The ID of the skin Good luck Note : Its For a 1 Skin Only Link to comment
MIKI785 Posted November 4, 2016 Share Posted November 4, 2016 @MR.NaiF-MTA i don't understand what is that supposed to solve, why use a timer? onClientResourceStart gets always triggered after all the files are downloaded (even the scripts get loaded afterwards). It's strange that it doesn't work, try removing the 44 in engineLoadDFF, that function actually takes only one argument (the DFF file) but it shouldn't matter in Lua. Link to comment
#STZ Posted November 5, 2016 Share Posted November 5, 2016 @MIKI785 I am so so sorry this is the right code txd = engineLoadTXD("489.txd") engineImportTXD(txd, 489) dff = engineLoadDFF("489.dff", 489) engineReplaceModel(dff, 489) Tested Replace The Id ( 489 ) With You ID Meta <meta> <info author="MR.NaiF" version="1.0" type="script" name="CAR"/> <script src="replace.lua" type="client" /> <file src="489.txd" /> <file src="489.dff" /> </meta> Link to comment
Dealman Posted November 5, 2016 Share Posted November 5, 2016 Make sure male01.dff is in the meta.xml. 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