Jump to content

custom object


Groll_Bixmes

Recommended Posts

this is the client.lua

change object name to your file name from .txd .dff .col

change item id to the item id you wanne replace with it

function map() 
    txd = engineLoadTXD ( "object name.txd" ) 
        engineImportTXD ( txd, Item ID ) 
    col = engineLoadCOL ( "object name.col" ) 
    dff = engineLoadDFF ( "object name.dff", 0 ) 
    engineReplaceCOL ( col, Item ID ) 
    engineReplaceModel ( dff, Item ID ) 
    engineSetModelLODDistance(Item ID, 2000) 
end 
  
setTimer ( map, 2000, 1) 
addCommandHandler("reloadmap",map) 
  
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), 
    function() 
        engineRestoreCOL(Item ID) 
        engineRestoreModel(Item ID) 
        destroyElement(dff) 
        destroyElement(col) 
        destroyElement(txd) 
    end 
) 
  

this is the .map

"race,editor_main"> 
    "object (cen_bit_19) (1)" interior="0" collisions="true" alpha="255" doublesided="true" model="Item ID" scale="1" dimension="0" posX="0.00" posY="0.00" posZ="0.00" rotX="0.00" rotY="0.00" rotZ="0.00"> 

Link to comment

this is the client.lua

change object name to your file name from .txd .dff .col

change item id to the item id you wanne replace with it

function map() 
    txd = engineLoadTXD ( "object name.txd" ) 
        engineImportTXD ( txd, Item ID ) 
    col = engineLoadCOL ( "object name.col" ) 
    dff = engineLoadDFF ( "object name.dff", 0 ) 
    engineReplaceCOL ( col, Item ID ) 
    engineReplaceModel ( dff, Item ID ) 
    engineSetModelLODDistance(Item ID, 2000) 
end 
  
setTimer ( map, 2000, 1) 
addCommandHandler("reloadmap",map) 
  
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), 
    function() 
        engineRestoreCOL(Item ID) 
        engineRestoreModel(Item ID) 
        destroyElement(dff) 
        destroyElement(col) 
        destroyElement(txd) 
    end 
) 
  

this is the .map

"race,editor_main"> 
    "object (cen_bit_19) (1)" interior="0" collisions="true" alpha="255" doublesided="true" model="Item ID" scale="1" dimension="0" posX="0.00" posY="0.00" posZ="0.00" rotX="0.00" rotY="0.00" rotZ="0.00"> 

im new to mta,can you please give me some more detailed instruction,and i cant find the .col for the object,i thought i only need dff and txd,can you help me to find the .col for the object?and where to put the script please?

Link to comment

dff = object ----- is the model

txd = textures ------ gives texture to the model

col = collison ------- makes je allow to walk / drive on object

if you dont have the .col file you need to make one idk how

you need to make a folder and put there the objects and lua client script and .map file

and make a meta.xml that loads the scripts map and files

Link to comment
dff = object ----- is the model

txd = textures ------ gives texture to the model

col = collison ------- makes je allow to walk / drive on object

if you dont have the .col file you need to make one idk how

you need to make a folder and put there the objects and lua client script and .map file

and make a meta.xml that loads the scripts map and files

i got the .col file,but i still didnt understood to apply the custom object,can you please tell me how to apply it step by step?like this

1.[what should i do] 
2.[what sould i do] 
3.what should i do] 

Link to comment

1. make a folder in your resource how ever you want to call it

2. put there your .txd .dff .col in

3. copy the scripts

4. edit the scripts [object name = how your txd dff col are called] [ item id = the object id you wanne replace with it]

if you wanne also have a maded meta.xml ask it

this is the client.lua

change object name to your file name from .txd .dff .col

change item id to the item id you wanne replace with it

function map() 
    txd = engineLoadTXD ( "object name.txd" ) 
        engineImportTXD ( txd, Item ID ) 
    col = engineLoadCOL ( "object name.col" ) 
    dff = engineLoadDFF ( "object name.dff", 0 ) 
    engineReplaceCOL ( col, Item ID ) 
    engineReplaceModel ( dff, Item ID ) 
    engineSetModelLODDistance(Item ID, 2000) 
end 
  
setTimer ( map, 2000, 1) 
addCommandHandler("reloadmap",map) 
  
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), 
    function() 
        engineRestoreCOL(Item ID) 
        engineRestoreModel(Item ID) 
        destroyElement(dff) 
        destroyElement(col) 
        destroyElement(txd) 
    end 
) 
  

this is the .map

"race,editor_main"> 
    "object (cen_bit_19) (1)" interior="0" collisions="true" alpha="255" doublesided="true" model="Item ID" scale="1" dimension="0" posX="0.00" posY="0.00" posZ="0.00" rotX="0.00" rotY="0.00" rotZ="0.00"> 

im new to mta,can you please give me some more detailed instruction,and i cant find the .col for the object,i thought i only need dff and txd,can you help me to find the .col for the object?and where to put the script please?

Link to comment

this is the client.lua

change object name to your file name from .txd .dff .col

change item id to the item id you wanne replace with it

function map()          -------------------client.lua 
    txd = engineLoadTXD ( "object name.txd" ) 
        engineImportTXD ( txd, Item ID ) 
    col = engineLoadCOL ( "object name.col" ) 
    dff = engineLoadDFF ( "object name.dff", 0 ) 
    engineReplaceCOL ( col, Item ID ) 
    engineReplaceModel ( dff, Item ID ) 
    engineSetModelLODDistance(Item ID, 2000) 
end 
  
setTimer ( map, 2000, 1) 
addCommandHandler("reloadmap",map) 
  
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), 
    function() 
        engineRestoreCOL(Item ID) 
        engineRestoreModel(Item ID) 
        destroyElement(dff) 
        destroyElement(col) 
        destroyElement(txd) 
    end 
) 
  

this is the .map

"race,editor_main">          --------------------- gta.map 
    "object (cen_bit_19) (1)" interior="0" collisions="true" alpha="255" doublesided="true" model="Item ID" scale="1" dimension="0" posX="0.00" posY="0.00" posZ="0.00" rotX="0.00" rotY="0.00" rotZ="0.00"> 

Link to comment
Do i have to create a new file?

Yes, you have to create a new text file for each of them and save them accordingly.

If you're just getting started, I highly recommend you to check out the official MTA Wiki. It will explain you how to set up a new resource and how .xml files work.

https://wiki.multitheftauto.com/wiki/Sc ... troduction

https://wiki.multitheftauto.com/wiki/Main_Page

what is the name for the .map file? gta.map ?and should i replace some of the contents of the .map file?

and im intrested of beeing a mapper

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