Jump to content

How to add this trees into mta


Recommended Posts

  • 1 month later...

Welcome to our forums!

I have moved your topic to the Scripting section, as you can get more help with this here
If you have further questions, ask them in the form of a reply and wait patiently for a helpful answer

Link to comment
  • 2 weeks later...

get the txd file of the model and then get the dff file of the model and the col of the model (i dont think you realy need to get the col file of the model)

then make a resource 

put your files in the resource and add them in the meta.xml

etc:

```<meta>

<script src="client.lua" type="client" />

<file src="your_dff_file_name.dff" />
<file src="your_txd_file_name.txd" />
 

</meta> ```
then make the client file and paste this into it

 
function onClientResourceStartReplaceModels()
    local modelsToReplace = {
        { -- replace object (all object IDs here: https://dev.prineside.com/en/gtasa_samp_model_id/)
            colFile = "your_col_file_name.col", -- if there is not col file then delete this part
            txdFile = "your_txd_file_name.txd",
            dffFile = "your_dff_file_name.dff",
            modelID = 1337, -- go to the map editor or try to get the tree model id :)
            alphaTransparency = false,
            filteringEnabled = true,
        }
    }
 
    for assetID = 1, #modelsToReplace do
        local modelData = modelsToReplace[assetID]
        local modelCol = modelData.colFile
        local modelTxd = modelData.txdFile
        local modelDff = modelData.dffFile
        local modelID = modelData.modelID
 
        if (modelCol) then
            local colData = engineLoadCOL(modelCol)
 
            if (colData) then
                engineReplaceCOL(colData, modelID)
            end
        end
 
        if (modelTxd) then
            local filteringEnabled = modelData.filteringEnabled
            local txdData = engineLoadTXD(modelTxd, filteringEnabled)
 
            if (txdData) then
                engineImportTXD(txdData, modelID)
            end
        end
 
        if (modelDff) then
            local dffData = engineLoadDFF(modelDff)
 
            if (dffData) then
                local alphaTransparency = modelData.alphaTransparency
               
                engineReplaceModel(dffData, modelID, alphaTransparency)
            end
        end
    end
end
addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStartReplaceModels)
 
read this script then past it and thats it :) i think this should work
 
Edited by 4eli6
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...