Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Speed Player

    You are putting the animation progress to 100% ever frame... That is the same as 0% progress.
  2. IIYAMA

    Speed Player

    An animation goes from 0 to 100%. That takes an amount of time. But what if you increase that progress?
  3. IIYAMA

    Speed Player

    Use this instead: https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress + onClientRender
  4. IIYAMA

    Speed Player

    Use resourceRoot, not getRootElement... or don't even use onResourceStart at all. Just run the line for the animation speed. Because wrong using this event can lead to bugs. Where are you starting the animation? Because it is missing in your code. Without animation you will not notice the difference. --------- P.s you might need this instead because it doesn't allow you to go faster than 100% = 1. https://wiki.multitheftauto.com/wiki/SetPedAnimationProgress
  5. IIYAMA

    Speed Player

    That is not ging to work. The GTA engine will adjust the running speed to the default until the ped leaves the ground. You could try to use a walk animation and speed it up: https://wiki.multitheftauto.com/wiki/SetPedAnimationSpeed
  6. startX = 0 startY = 0 sizeX = 100 sizeY = 20 endX = startX + sizeX endY = startY + sizeY dxDrawText("text", startX, startY, endX, endY, ...
  7. (Mobile) dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") > This is not scaled. Take a closer look at how you did that with the rectangle. dxDrawText(v, startRectangleX, posY-startRectangleY+i*57, sizeX, sizeY,tocolor(255,255,255,255),1,"default-bold","right","top") > dxDrawText doesn't make use of sizes. But end points. (startpoint + size = endpoint) Overall, > mirror what you did with the rectangle. > use endpoints instead of the size. > center the text vertically. Between the 2 startpoints and the 2 endpoints.
  8. Did you already check the community? I saw a resource where an object is used to force the camera to first-person. Also please don't bump, not everybody has every hour time to checkout the posts.
  9. Don't use "onPlayerJoin", for downloading. Client checks for files. client > server Tells the server which files there are already. The server compares the files. The server downloads the files from the external server. (Caching files for a 1 minute?) server > client The server sends the files back. Client loads the mods either from already downloaded files or directly from the RAW data. Best to load the mods that are already downloaded at this moment. As you might want to update mods in the future. There is no onPlayerJoin in that cycle.
  10. You need to write the txd data to the file but not the loaded txd.
  11. Why are you trying to write a loaded txd? > fileWrite(file, txd)
  12. You do not have to use filepaths serverside, as there are URL's. But you do need something to compare the downloaded files with the (serverside) URL's. That is when you need an identifier. You could use the URL for that, as it is always unique. Your approach sounds correctly.
  13. Compare filesizes, best way to validate if the file is incorrect. There is only 1 way to figure that out and that is to debug every step. And every variable that plays an important role. The update function is used to update the file, when you have replaced the old one with with a new one. This is something for the future. Line 70 is using the filepaths that are the old ones. Line 72 is delivering the new ones. Meta doesn't make use of include tag. <include resource="xmlData" /> Line 65 it's value should be set after onClientResourceStart.
  14. Loop in line 26 is not required. Keep in mind that you might want to update 1 of the files instead of both. When you update/create the filepaths you also need to save the files. As well as saving the filepaths in the xml saving resource.
  15. Yes, but in parts, as every part has to be build with precision. First try to get an understanding of the resource. https://wiki.multitheftauto.com/wiki/XmlData#Simplifying_the_export Then create a table format that could be used for the file management. For example: { [470] = { txd = "files/470/mod.txd", dff = "files/470/mod.dff" }, [...] = { ... } } You must create some functions that can create and update your format. I will give you more steps when this part is finished. Note, you shouldn't save your mods inside of XML. The file will get too big too quickly.
  16. Yes that is happening. If you do not want that to happen, you have to do a lot more work. The first part is file management. "Which files does the client have downloaded?" You can use this resource for keeping track of the file locations and statuses. https://community.multitheftauto.com/index.php?p=resources&s=details&id=16187 And for writing the files: https://wiki.multitheftauto.com/wiki/FileCreate 1. Client [resource:xmldata] These are the files I have on my computer! > triggerServerEvent 2. Server These files are available to download. Filter out the files that have already been downloaded. > triggerClientEvent 3.Client Create new files fileCreate() and update the file management [resource:xmldata]. Yes, that is very much possible. triggerLatentClientEvent(player, ...) local handles = getLatentEventHandles (player) local handle = handles[#handles] local status = getLatentEventStatus(player, handle) iprint((status.percentComplete or 100) .. "%")
  17. Did you debug the data?
  18. getting better local col = modelDataList.col if col then local col_loaded = engineLoadCOL (col) if col_loaded then engineReplaceCOL (col_loaded, model ) end end local txd = modelDataList.txd if txd then local txd_loaded = engineLoadTXD(txd) if txd_loaded then engineImportTXD(txd_loaded, model) end end local dff = modelDataList.dff if dff then local dff_loaded = engineLoadDFF(dff) if dff_loaded then engineReplaceModel(dff_loaded, model) end end
  19. Model and data? Where is that defined? The modelDataList from line 10 is what you have to send, when the server is finished with getting the data.
  20. You are sending nothing. Maybe it is a good idea to send what you want to send. And is 10 seconds delay enough?
  21. You can check the status of latent events. Also you might have bugged it (happend to me once), so restarting the client and the server. downloadFile doesn't work, as the files have to be initiated before the resource start. Without you can't even start the resource. Show serverside. Also keep in mind that you can't send files if they are not downloaded by the server yet. onPlayerJoin can't be used for players that are already in the server.
  22. It probably it takes too long to transfer the data without changing the bandwidth settings. The triggerClientEvent is very aggressive and will be high prioritised as well as blocking everything else untill it is finished.
  23. Just some inspiration, normally I do not write so much code on the forum, untested. -- INPUT local links = { { model = 560, txd = "https://cdn-20.anonfile.com/n9r7yfG3nd/e52c4b4d-1576530500/sultan.txd", dff = "https://cdn-07.anonfile.com/99u8y2G1n9/35d1852b-1576531060/sultan.dff" } } -- OUTPUT local modelDataList = {} -- local fileTypeLoadOrder = { "col", "txd", "dff" } do -- This is a temporary function. Only used for the initial state. local fileRequest = function (err, data, linkIndex, fileType) if (err) then print(err) end outputChatBox("Download started", root) local link = links[linkIndex] local model = link.model -- make a new container if not exist local modelData = modelDataList[model] if not modelData then modelData = { fileCountRemaining = link.fileCount } modelDataList[model] = modelData end -- save the data modelData.model = model modelData[fileType] = data modelData.fileCountRemaining = modelData.fileCountRemaining - 1 -- clean up if modelData.fileCountRemaining == 0 then modelData.fileCountRemaining = nil modelData.ready = true end end -- Loop through all the links for i=1, #links do local link = links[i] -- Keep track of the amount of files that need to be downloaded local fileCount = 0 -- Loop through all the file types in order. for j=1, #fileTypeLoadOrder do local fileType = fileTypeLoadOrder[j] local url = link[fileType] if url then -- If file type has an URL, then try to download it. fetchRemote(url, fileRequest, "", false, i, fileType) fileCount = fileCount + 1 -- + file end end link.fileCount = fileCount end end
  24. Did you check the link with a (000webhost not logged in) browser? Yes, you can do that. But don't make the queue too long.
  25. Correct!
×
×
  • Create New...