roDaN Posted December 23, 2014 Share Posted December 23, 2014 Salutatare, am si eu nevoie de putin ajutor... Am incercat eu sa fac dar am dat gres, am tot incercat... Folosesc script-ul viewtopic.php?f=108&t=36481 Vreau ca jucatorul sa descarce mod-urile dupa ce s-a conectat, pt. ca am observat ca multora nu le convine sa vad un ecran nergru si sa astepte n minute pt. ca au o conexiune slaba si le dau dreptate... Daca ma puteti ajuta va raman recunoscator... EDIT: Ca sa nu mai fac alt topic daca ma puteti ajuta si cu o metoda de protejare a client side-ului... Am folist fileDelete("fisier.lua") dar am inteles ca nu este prea securizata, adica daca se deconecteaza in timpul descarcari tot raman fisierele in clientul MTA. Link to comment
Strike27208 Posted December 24, 2014 Share Posted December 24, 2014 Trebuie sa editezi putin prin el ( meta ) si sa modifici ce iti dau eu acum function StarDown () downloadFile ( "nume.txd" ) downloadFile ( "nume.dff" ) end addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), StarDown ) Si in meta pui la fiecare fisier --- download="false"/> Asta este ceva optional daca vrei sa il pui sa-ti arate cand a terminat cu descarcarea masinii. function onDownloadFinish ( file, success ) if ( source == resourceRoot ) then if ( success ) then if ( file == "nume.dff" ) then outputChatBox ( "Car download finished" ) end else if ( file == "test.mp3" ) then outputChatBox ( "Car failed to download" ) end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) Link to comment
roDaN Posted December 24, 2014 Author Share Posted December 24, 2014 Am incercat dar nu functioneaza... Link to comment
Strike27208 Posted December 26, 2014 Share Posted December 26, 2014 Am incercat dar nu functioneaza... Ai incercat metoda asta sau ce ti-am dat eu ?? Link to comment
roDaN Posted December 26, 2014 Author Share Posted December 26, 2014 Am incercat dar nu functioneaza... Ai incercat metoda asta sau ce ti-am dat eu ?? Da, am facut si un script nou si degeaba... Nu le descarca si in debugscript nu apare nimic... Link to comment
Strike27208 Posted December 27, 2014 Share Posted December 27, 2014 Am incercat dar nu functioneaza... Ai incercat metoda asta sau ce ti-am dat eu ?? Da, am facut si un script nou si degeaba... Nu le descarca si in debugscript nu apare nimic... Era din cauza event-ului function StarDown () downloadFile ( "nume.txd" ) downloadFile ( "nume.dff" ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), StarDown) Si pentru replace function replaceModel () txd = engineLoadTXD ( "nume.txd" ) engineImportTXD ( txd, 463 ) dff = engineLoadDFF ( "nume.dff", 463 ) engineReplaceModel ( dff, 463 ) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) Problema sta in felul urmator ! El nu incarca modul imediat trebuie un reconnect ca sa incarce modul , il descarca dar nu ii da replace. Si nu sunt sigur ca porneste imediat dupa ce te-ai connectat. Aici daca ai un login panel poti folosi "triggerClientEvent" si "addEventHandler " Uite un exemplu : function StarDown () downloadFile ( "nume.txd" ) downloadFile ( "nume.dff" ) end addEvent ( "StarDown", true ) addEventHandler ( "StartDownload", getRootElement() ) ------------Si acuma pui linia asta la login panel (daca ai ) cauti linia unde scrie onClienLogin sau in alta parte.Nu stiu sa-ti explic exact. triggerEvent ( "StartDownload", getRootElement() ) ------------Si la celalalt la fel. Link to comment
razvan2299 Posted February 1, 2015 Share Posted February 1, 2015 Pentru protejare le poti baga in .luac ;P 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