Jump to content

[BUG] Fail to replace Gas Station Models


DriFtyZ

Recommended Posts

Hello community, i've made a simple loader script to replace the stock gas station in Los Santos, the assets seem to load and i see that mta tries to load the model but it doesn't in the end. Stock Gas Station Remains. Also no errors or anything in debugscript 3. here's my code i can't find the mistake here. Thanks

local Models = {
    laepetrol1a = 5409,
    washgaspump = 1676,
}

local Textures = {
    barrio1_lae = 5409,
    wshxrefpump = 1676,
}

local COLS = {
    lae_4   = 1676,
}

local SHELL_PATH = "assets/Shell/"

addEventHandler("onClientResourceStart", resourceRoot, function()
    -- Load Textures First
    for name, id in pairs(Textures) do
        local txd = engineLoadTXD ( SHELL_PATH .. name .. ".txd" )
        engineImportTXD ( txd, id )
        outputDebugString("GasStation: Loaded TXD (" .. SHELL_PATH .. name .. ".txd) | ID: " .. id)
    end
    for name, id in pairs(Models) do
        local dff = engineLoadDFF ( SHELL_PATH .. name .. ".dff" )
        engineReplaceModel ( dff, id )
        outputDebugString("GasStation: Loaded DFF (" .. SHELL_PATH .. name .. ".dff) | ID: " .. id)
    end
    for name, id in pairs(COLS) do
        local col = engineLoadCOL ( SHELL_PATH .. name .. ".col" )
        --engineReplaceCOL ( col, id )
        outputDebugString("GasStation: Loaded COL (" .. SHELL_PATH .. name .. ".col) | ID: " .. id)
    end
end)

 

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