Jump to content

What wrong in this? First skin is working fine, second skin is bad argument.. What?!


Turbe$Z

Recommended Posts

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.. :S

  • Like 1
Link to comment
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  :D

Link to comment

@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

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...