Rubin Posted December 15, 2014 Share Posted December 15, 2014 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.. Link to comment
roDaN Posted December 15, 2014 Share Posted December 15, 2014 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. Link to comment
Rubin Posted December 15, 2014 Author Share Posted December 15, 2014 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. Link to comment
roDaN Posted December 15, 2014 Share Posted December 15, 2014 Nu cunosc functia, stiu ca Axel a facut asa ceva pe vr... Intreaba-l pe el. Link to comment
crismar Posted December 16, 2014 Share Posted December 16, 2014 Atributul meta.xml pt. mod: download="false" Si folosesti downloadFile pe eventHandlerul "onPlayerLogin". Link to comment
Rubin Posted December 16, 2014 Author Share Posted December 16, 2014 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"/> Link to comment
crismar Posted December 16, 2014 Share Posted December 16, 2014 /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. Link to comment
Rubin Posted December 16, 2014 Author Share Posted December 16, 2014 Zice ca e : Incorrect client type for this command! Link to comment
F4sT Posted February 22, 2017 Share Posted February 22, 2017 (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 February 22, 2017 by F4sT Ceva bugfixuri. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now