FlyingSpoon Posted June 7, 2017 Share Posted June 7, 2017 addEventHandler("onResourcePreStart", rootElement, function (startingResource) fetchRemote("http://link.com/maps/", function(data, errno) if errno == 0 then outputChatBox("Error fetching maps: " .. errno) return end end) --Is starting resource a gamemode? if isGamemode(startingResource) then --Check if another gamemode is running already if getRunningGamemode() and getRunningGamemode() ~= startingResource then -- Initiate a new changemode sequence and cancel this event outputMapManager( "Initiating changemode from '" .. getResourceName(getRunningGamemode()) .. "' to '" .. getResourceName(startingResource) .. "'" ) changeGamemode(startingResource) cancelEvent(true) end elseif isMap(startingResource) then --Check if another map is running already if getRunningGamemodeMap() and getRunningGamemodeMap() ~= startingResource then -- Initiate a new changemap sequence and cancel this event if isGamemodeCompatibleWithMap ( getRunningGamemode(), startingResource ) then outputMapManager( "Initiating changemap from '" .. getResourceName(getRunningGamemodeMap()) .. "' to '" .. getResourceName(startingResource) .. "'" ) changeGamemodeMap(startingResource) end cancelEvent(true) end end end ) So this is the default mapmanager, can't really figure out how to actually fetch the maps, so maps are uploaded via .ZIP format on to the website, and I'm trying to get all the maps, and load them instead of the default location [maps]. How should I do it? Link to comment
pa3ck Posted June 7, 2017 Share Posted June 7, 2017 Sorting out the zip and stuff should be handled by your website. From lua you can then read in the map data, save it then load it in. Link to comment
koragg Posted June 8, 2017 Share Posted June 8, 2017 Here's something that may help in uploading maps to your website: https://github.com/JarnoVgr/Mr.Green-MTA-Resources/tree/master/www/mta 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