Jump to content

Open a map from .zip file ?


Guest Guest26901

Recommended Posts

Hey all !

How to open map from .zip file ? I did something like this:

  
local files = { "maps/edos.zip", "maps/shootermcqueen.zip" } 
  
function openNextMap() 
    local randomFile = files[math.random(#files)] 
    --local hFile = fileOpen(randomFile, true) 
    if randomFile then 
        outputDebugString("File opened! //random_maps.lua") 
        startResource(randomFile) 
    else 
        outputDebugString("Unable to open files - maps! //random_maps.lua") 
    end 
end 
addEventHandler("onResourceStart", getRootElement(), openNextMap) 
  

Link to comment
local resources = { "edos", "shootermcqueen" } 
  
function openNextMap ( ) 
    local randomResource = resources [ math.random ( #resources ) ] 
    if ( randomResource ) then 
        outputDebugString ( "File opened! //random_maps.lua" ) 
        startResource ( getResourceFromName ( randomResource ) ) 
    else 
        outputDebugString ( "Unable to open files - maps! //random_maps.lua" ) 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, openNextMap ) 

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