Jump to content

[?] Custom Vehicle DFF & TXD


Caneman

Recommended Posts

Posted

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>  

Posted

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>  

Posted

I changed the hunter_client.lua to

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

the dff definitely changed, all tho it doesn't look like the txd worked

Posted

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) 

Posted

Yep, there are known bugs to the engine functions. They will be sorted out as soon as possible.

Linus Torvalds: "Software is like sex: it's better when it's free."

Posted

when I placed new models, driver was sitting in the center of vehicle not in seat? How can I fix it?

lua = SH|T

pawno 4ever

Posted

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)

Posted

mitchPS the name doesnt matter, so just rename the .txd file you have, all you neeed to worry about is the ID

Posted

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.

CJGrove.pngCJGrove.png

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

Kevuwk

Any comments made are purely my own and do not represent the interests of the MTA Team

Posted

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) 

Posted

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 :)

Finnish Multi Theft Auto Networks Community @ http://fin-mta.net

233040547.png

OWNED :D 100mbit fiber linez ownz :)

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