Szerző Téma: Mta Kocsimod  (Megtekintve 900 alkalommal)

Mta Kocsimod
« Dátum: 2018. Január 11. - 06:29:41 »
0
Hali kaptam egy módot teljesen kocsimodokal de sajnos valamiért nem akkar betölteni ez mi miatt lehet? Sajnos azt csinálja amikor fent vagyok hogy betöltés folyamatba és semmi 
 
 
 
local tempTable = {}
local modCount = 0
local allModCount = 0
local keys = 0
local loadedMods = {}
local modKeys = {}
local buggedVehs = 1
 
function addFile(file, mod)
    if not downloadFile(file) then
        outputDebugString(file..\" nem található!\")
    else
        allModCount = allModCount + 1
        modCache[file] = mod
        if not modKeys[mod] then
            keys = keys + 1
            modKeys[mod] = keys
        end
    end
end
 
local sx,sy = guiGetScreenSize()
local imgrot = 0
function renderGTAVLoading()
    local percent = math.floor((modCount/allModCount)*100)
    if percent == 100 then
        allModCount = 0
        modCount = 0
        buggedVehs = 1
        tempTable = {}
        modKeys = {}
        keys = 0
        removeEventHandler(\"onClientRender\", root, renderGTAVLoading)
    end
    dxDrawRectangle(sx-200,sy-25,200,25,tocolor(0,0,0,180), true)
    imgrot = imgrot + 5
    dxDrawImage(sx-195,sy-23,20,20,\"loading.png\", imgrot, 0, 0, nil, true)
    dxDrawText(\"Betöltés folyamatban (\"..percent..\"%)\",sx-165,sy-19,20,20,tocolor(255,255,255,255),1,\"default\",\"left\",\"top\",false,false,true)
    loadMods()
end
 
function restoreAllModels()
    -- teljes ram tisztítás
    local restored = {}
    for k,v in pairs(loadedMods) do
        if not restored[k] then
            engineRestoreModel(k)
            restored[k] = true
        end
    end
    loadedMods = {}
    for k,_ in pairs(vehicleParts) do
        for key,value in pairs(vehicleParts[k]) do
            if not restored[value] then
                engineRestoreModel(value)
                restored[value] = true
            end
        end
    end
    restored = nil
end
addCommandHandler(\"ki\", restoreAllModels)
 
local startTimer
function loadMods()
    startTimer = setTimer(function()
        if not isTransferBoxActive() then
            killTimer(startTimer)
            loadedMods = {}
            for k,v in pairs(modCache) do
                addFile(k, v)
            end
            for k,_ in pairs(vehicleParts) do
                for key,value in pairs(vehicleParts[k]) do
                    addFile(key, value)
                end
            end
            addEventHandler(\"onClientRender\", root, renderGTAVLoading)
        end
    end, 2000, 0)
end
addEventHandler(\"onClientResourceStart\", resourceRoot, loadMods)
addCommandHandler(\"be\", loadMods)
 
addCommandHandler(\"reloadcar\", function(cmd, id)
    local id = tonumber(id) or 0
    local i = 0
    for k,v in pairs(modCache) do
        if v == id then
            addFile(k, v)
            i = i + 1
        end
    end
    if i > 0 then
        addEventHandler(\"onClientRender\", root, renderGTAVLoading)
        outputChatBox(\"[HL] #FFFFFFJármű újratöltve!\", 0, 255, 0, true)
    else
        outputChatBox(\"[HL] #FFFFFFNincs ilyen jármű a listában!\", 0, 255, 0, true)
    end
end)
 
addEventHandler(\"onClientFileDownloadComplete\", root, function(file,success)
    if source == resourceRoot then
        if success then
            local kit = string.sub(file, -4)
            if kit == \".dff\" then
                local name = file:gsub(\".dff\", \"\")
                local mod = tonumber(modCache[file]) or 0
                if mod < 1000 and mod > 0 then
                    if modCache[name..\".txd\"] then
                        if fileExists(name..\".txd\") then
                            if not loadedMods[mod] then
                                loadVehicleMod(name, mod, modKeys[mod])
                            end
                        end
                    else
                        if not loadedMods[mod] then
                            loadDFF(name,mod)
                        end
                    end
                    modKeys[file] = nil
                end
                modCount = modCount + 1
            elseif kit == \".txd\" then
                local name = file:gsub(\".txd\", \"\")
                local mod = tonumber(modCache[file]) or 0
                if mod < 1000 and mod > 0 then
                    if modCache[name..\".dff\"] then
                        if fileExists(name..\".dff\") then
                            if not loadedMods[mod] then
                                loadVehicleMod(name, mod, modKeys[mod])
                            end
                        end
                    else
                        if not loadedMods[mod] then
                            loadTXD(name, mod)
                        end
                    end
                    modKeys[file] = nil
                end
                modCount = modCount + 1
            end
        end
    end
end)
 
function loadVehicleMod(file, mod, key)
    if key then
        local file = file:gsub(\".dff\",\"\")
        local bugged = buggedVehicles[mod]
        if not bugged then
            loadTXD(file, mod)
            loadDFF(file,mod)
        else
            loadTXD(file, mod)
            setTimer(loadBuggedParts, 200*key, 1, file, mod)
        end
    end
end
 
function loadDFF(file,mod)
    file = file:gsub(\".dff\",\"\")
    dff = fileExists(file..\".dff\") and engineLoadDFF(file..\".dff\", mod) or false
    if dff then
        engineReplaceModel(dff, mod)
        loadedMods[mod] = true
    end
end
 
function loadTXD(file, mod)
    txd = fileExists(file..\".txd\") and engineLoadTXD(file..\".txd\") or false
    if txd then
        engineImportTXD(txd, mod)
    end
end
 
function loadBuggedParts(file,mod)
    if vehicleParts[mod] then
        local dff = fileExists(file..\".dff\") and engineLoadDFF(file..\".dff\", mod) or false
        if dff then
            engineReplaceModel(dff, mod)
            loadedMods[mod] = true
        end
        for k,v in pairs(vehicleParts[mod]) do
            local dff = fileExists(k) and engineLoadDFF(k, mod) or false
            if dff then
                engineReplaceModel(dff, v)
            end
        end
    end
end

Mta Kocsimod
« Válasz #1 Dátum: 2018. Január 11. - 16:11:09 »
0

/debugscript 3 

 
Nézd meg, hogy mit ír ki hibának és akkor lehet tovább gondolkodni.

Mta Kocsimod
« Válasz #2 Dátum: 2018. Január 11. - 17:34:47 »
0
function loadMods()
    startTimer = setTimer(function()
        if not isTransferBoxActive() then
            killTimer(startTimer)
            loadedMods = {}
            for k,v in pairs(modCache) do
                addFile(k, v)
            end
            for k,_ in pairs(vehicleParts) do
                for key,value in pairs(vehicleParts[k]) do
                    addFile(key, value)
                end
            end
            addEventHandler(\"onClientRender\", root, renderGTAVLoading)
        end
    end, 2000, 0)
end
addEventHandler(\"onClientResourceStart\", resourceRoot, loadMods)
addCommandHandler(\"be\", loadMods)
 
 
 
 
 
Erre dob egy warningot
« Utoljára szerkesztve: 2018. Január 11. - 17:38:56 írta xXCsucsuXx »

Mta Kocsimod
« Válasz #3 Dátum: 2018. Január 11. - 18:09:12 »
0
Szóról-szóra írd le/fotózd le a warningot.

Mta Kocsimod
« Válasz #4 Dátum: 2018. Január 11. - 18:47:56 »
0
Nah szóval megvan! Itt van
 
1.png ezen látszik a betöltés warning
 
2.png
 
3.png
« Utoljára szerkesztve: 2018. Január 11. - 18:50:40 írta xXCsucsuXx »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal