Jump to content

[SOLVED]Loading textures problem


Miika

Recommended Posts

Hi,

My mod downloader script replaces only first item from table.

This is part of my script:

------{CLIENT}------

[Table]

modTable = { 
    --{"Name", "example.txd", "example.dff", "vehicle id", "vehicle to replace"} 
    {"Chevrolet Corvette Sport", "mods/euros.txd", "mods/euros.dff", 587, "Euros"}, 
    {"Nissan Micra 2011 Stance Itasha", "mods/peren.txd", "mods/peren.dff", 404, "Perennial"} 
} 

[Replace function]

function applymods() 
    local num = 0 
    for k, v in ipairs (modTable) do 
    local num = num + 1 
        if (modTable[num]) then 
            if (fileExists(modTable[num][2])) and (fileExists(modTable[num][3])) then -- I have all mods in client folder 
                txd = engineLoadTXD(modTable[num][2]) 
                engineImportTXD(txd, modTable[num][4]) 
                dff = engineLoadDFF(modTable[num][3]) 
                engineReplaceModel(dff, modTable[num][4]) 
            end 
        end 
    end 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), applymods) 
addEventHandler("onClientFileDownloadComplete", getResourceRootElement(getThisResource()), applymods) 

No any errors in debugscript

Edited by Guest
Link to comment
function applymods() 
    for num=1, #modTable do 
        if (modTable[num]) then 
            if (fileExists(modTable[num][2])) and (fileExists(modTable[num][3])) then -- I have all mods in client folder 
                txd = engineLoadTXD(modTable[num][2]) 
                engineImportTXD(txd, modTable[num][4]) 
                dff = engineLoadDFF(modTable[num][3]) 
                engineReplaceModel(dff, modTable[num][4]) 
            end 
        end 
    end 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), applymods) 

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