Jump to content

download too long (system with files downloader?)


yoya99

Recommended Posts

Hi there in my server i have too mayn car downloads, skins and shaders....is therea way to make for that files a background download system?So players can acess the whole game butwith a background downlaod for additional files like skins,cars and shaders? i saw that resource in the community: https://community.multitheftauto.com/index.php?p=resources&s=details&id=3379

but i really dont have any idea how to do that :( helpp ppls :cry:

Link to comment

If you've got no idea how Lua works, stop trying to open a server.

Anyway, here's how to do it:

After adding mods in XML, add for each attribute "download" and set it to "false".

Then you can addEventHandler for onPlayerLogin (f.e) and downloadFile for each mod you have. This way players can join the server and download the mods subsequently.

Link to comment
If you've got no idea how Lua works, stop trying to open a server.

Then you can addEventHandler for onPlayerLogin (f.e) and downloadFile for each mod you have. This way players can join the server and download the mods subsequently.

Mmh i dont understand the secnd part...can you give me an example?

Link to comment

Add "download" attribute in Meta.xml as "false" for all mod files.

Then use this:

  
local downloadFiles = { 
-- Add your mods in this table in format: {string theDFF, string theTXD, int theVehicleModel} 
} 
  
function loadMods() 
for i, v in ipairs(downloadFiles) do 
downloadFile(v[1]) 
downloadFile(v[2]) 
texture = engineLoadTXD(v[2]) 
engineImportTXD(texture, v[3]) 
struct = engineLoadDFF (v[1], 0) 
engineReplaceModel(struct, v[3]) 
end 
end 
addCommandHandler("loadmods", loadMods, false) 
  

Link to comment

We're not here to write you scripts. I provided you a fully functional scrpit which you can easily modify by changing commandHandler with a eventHandler. And first line provides you with a wiki-like sintax, once again I provide you already more then you could ask for.

Link to comment

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