Jump to content

[?] Custom Vehicle DFF & TXD


Caneman

Recommended Posts

My code looks like this

hunter_client.lua

 txd = engineLoadTXD("data/voodoo.txd") 
engineImportTXD(txd, 412) 
dff = engineLoadDFF("data/voodoo.dff") 
engineReplaceModel(dff, 412) 

My data folder is in the same directory as the script, and when i join the game it starts downloading but it stops pretty fast, but the

voodoo is still a voodoo.

My meta.xml

 <meta> 
    <info author="Mack" name="The Hunter" version="1" type="gamemode" /> 
    <script src="hunter.lua" /> 
    <script src="hunter_client.lua" type="client" /> 
</meta>  

Link to comment

You have to specify the mod files in the meta.xml file...

 <meta> 
    <info author="Mack" name="The Hunter" version="1" type="gamemode" /> 
    <script src="hunter.lua" /> 
    <script src="hunter_client.lua" type="client" /> 
</meta>  

should be

<meta> 
    <info author="Mack" name="The Hunter" version="1" type="gamemode" /> 
    <script src="hunter.lua" /> 
    <script src="hunter_client.lua" type="client" /> 
    <file src="data/voodoo.dff" /> 
    <file src="data/voodoo.txd" /> 
</meta>  

Link to comment

Just game mode related stuff, the only thing their related to the vehicle is

function setupHunterWorld() 
    setWeather(
    setTime(00, 00) 
    createVehicle(412, -1640.8066,-2251.2615,31.4445,0.0, 0.0,87.2019) 
end 
  
addEventHandler("onResourceStart", getRootElement(), setupHunterWorld) 

Link to comment

yes i had the same bug,

If you load the vehicle, AND THEN load the TXD the .txd files work (when i say load the vehicle i dont mean .dff i mean the acctually vehicle model, like, i set a timer after

onPlayerJoin because thats when vehicles are created for a player)

Link to comment

I'm not so good at scripting i'm sorry but can someone tell why this script doesn't work?

lambo.lua

function EngineImportTXD() 
    txd = engineLoadTXD("supergt.txd") 
    engineImportTXD(txd, 506) 
    dff = engineLoadDFF("supergt.dff", 506) 
    engineReplaceModel(dff, 506) 
end 
bool engineImportTXD ( supergt.txd, 506 ) 
  
function EngineLoadDFF() 
txd = engineLoadTXD ( "supergt.txd" ) 
engineImportTXD ( txd, 506 ) 
dff = engineLoadDFF ( "supergt.dff", 506 ) 
engineReplaceModel ( dff, 506 ) 
end 
dff engineLoadDFF ( supergt.dff, 506 ) 
  
function EngineLoadTXD() 
txd = engineLoadTXD ( "supergt.txd" ) 
engineImportTXD ( txd, 506 ) 
dff = engineLoadDFF ( "supergt.dff", 506 ) 
engineReplaceModel ( dff, 506 ) 
end 
txd engineLoadTXD ( supergt.txd ) 
  
function EngineReplaceModel() 
txd = engineLoadTXD ( "supergt.txd" ) 
engineImportTXD ( txd, 506 ) 
dff = engineLoadDFF ( "supergt.dff", 506 ) 
engineReplaceModel ( dff, 506 ) 
end 
bool engineReplaceModel ( supergt, 506 ) 
  
  
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), EngineImportTXD) 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), EngineLoadDFF) 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), EngineLoadTXD) 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), EngineReplaceModel) 

meta.xml

<meta> 
    <info author="CJGrove" name="Lambo" version="1" type="script" /> 
    <script src="lambo.lua" type="client"/> 
    <file src="supergt.dff" /> 
    <file src="supergt.txd" /> 
</meta>  

It just doesn't work.

Link to comment
function replaceModel() 
  txd = engineLoadTXD ( "supergt.txd" ) 
  engineImportTXD ( txd, 506 ) 
  dff = engineLoadDFF ( "supergt.dff", 506 ) 
  engineReplaceModel ( dff, 506 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 

Link to comment

i did as you said kevuwk, but the car is white, loli did as you said, but the car is white, lol

i mean that textures doesn't load

(whole script with .txd and .dff files: http://www.sendspace.com/file/47b5u2)

54108555js6.jpg

function replaceModel() 
    txd = engineLoadTXD ( "data/supergt.txd" ) 
    engineImportTXD ( txd, 506 ) 
    dff = engineLoadDFF ( "data/supergt.dff", 506 ) 
    engineReplaceModel ( dff, 506 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 

Link to comment

function replaceModel() 
  txd = engineLoadTXD ( "supergt.txd", 506 ) 
  engineImportTXD ( txd, 506 ) 
  dff = engineLoadDFF ( "supergt.dff", 506 ) 
  engineReplaceModel ( dff, 506 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 

Try this, it works for me :)

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