Jump to content

Script Download!


Recommended Posts

Posted

Asi vrea si eu un script de download pentru moduri , sa numai sa se blocheze.. Sa fie orice fel de download pentru moduri numai sa nu se mai blocheze ,,,, sa numai apara jos MB..

Posted

Din cate stiu eu depinde de PC-ul jucatorului daca se blocheaza sau nu, cat despre bara de download progress nu poti sa o scoti/ascunzi pt. ca este implementata in MTA.

Posted

Nu are treaba cu mapa server-ului ce cu modurile , cand intri pe un sv se incarca modurile .... aia nu vreau sa mai apara...

Si sa se downloadeze modurile dupa ce intri pe server.

Posted

Ce am gresit aici? De nu merge?

--download system 
  
local numberOfIndex = { "585.txd", "585.dff" } 
  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), 
    function () 
        for _, index in ipairs ( numberOfIndex ) do 
            if fileExists( index ) then 
                setElementData(localPlayer, "modsDownloaded", true) 
            return 
        end 
        executeCommandHandler("checkthisshit") 
        setElementData(localPlayer, "modsDownloaded", false) 
        exports.download:downloadFile("".. index .."", "".. index .."", 500) 
        outputChatBox("".. index .."", localPlayer, 255, 0, 200, false) 
        exports.download:downloadFile("585.dff", "585.dff", 500) 
    end 
end 
) 
  
  
addEventHandler("onClientDownloadComplete", getRootElement(), -- woowww super long function. I think this could be done way shorter. (im a newb) 
function (theFile) 
    if theFile == ":Mods/585.txd" then 
        outputChatBox("585.txd has been downloaded!", localPlayer, 255, 255, 255, false) 
    end 
    if theFile == ":Mods/585.dff" then 
        outputChatBox("585.dff has been downloaded!", localPlayer, 255, 255, 255, false) 
        triggerEvent("downloadWindowFalse", localPlayer) 
        setElementData(localPlayer, "modsDownloaded", true)  
    end 
end 
) 

    <file src="585.txd" download="false"/> 
    <file src="585.dff" download="false"/> 
  

Posted

/debugscript 3 cand esti logat ca admin si spune-mi ce erori da.

Si, din ce vad aici, scriptul nu e facut de tine, exports.download:downloadFile cred ca e prima problema. Si mai ai erori, unde e command handlerul ':~' etc.

  • 2 years later...
Posted (edited)

Salut, știu că e de mult topicul, dar poate te mai uiți.

function(descarcaFisier)
    downloadFile('fisier.txd') -- > Aici pui fisiere
  -- Exemple mai multe:
    downloadFile('infernus.txd')
    downloadFile('infernus.dff')
end
addEventHandler('onClientResourceStart', resourceRoot, descarcaFisier)

Meta:

<meta>
 <script src='resursa.lua'/>
 <file src='infernus.dff' download='false' />
 <file src='infernus.txd' download='false' />
</meta>

Dacă vrei și loader:

function incarcaMod (resursaPornita) 
if(resursaPornita == getThisResource()) then 
outputChatBox('Status Moduri > Încărcate.', 0, 255, 0) 
txd = engineLoadTXD('infernus.txd')
engineImportTXD (txd, 411) 
dff = engineLoadDFF('infernus.dff', 411) 
engineReplaceModel (dff, 411) 
             end 
end 
addEventHandler("onClientResourceStart", getRootElement(), incarcaMod)

 

Edited by F4sT
Ceva bugfixuri.

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