Jump to content

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


Turbe$Z

Recommended Posts

Posted
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

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
26 minutes ago, MIKI785 said:

male01.dff is either missing or corrupted.

i tried another dff but doesn't working :S

  • Like 1

My Fun server:

560x95_FFFFFF_FF9900_000000_000000.png

My DD server:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
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

p_5141g3501.png

 

Posted

@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.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted

@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>

 

p_5141g3501.png

 

Posted

Make sure male01.dff is in the meta.xml.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

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