Jump to content

Download


Recommended Posts

Create a new lua file -> Add it to meta.xml and set type to "client" -> add this code:

function LoadAllMods ()
    Inter.refresh ( );
  
    -- if player is in vehicle then don't load mods
    if ( localPlayer:getOccupiedVehicle ( ) ) then
       outputChatBox ( "Please exit your vehicle before enabling or disabling mods. Retrying in 15 seconds", 255, 255, 0 );
    
       -- retry in 15 seconds by calling the same function again
       setTimer (LoadAllMods, 15000,1)
       return false
    end
	
    -- download the mods
    for i, v in pairs ( Downloader.Mods ) do 
        Mods.SetModEnabled ( i, true );
    end 

    Inter.refresh ( );
    return true
end

LoadAllMods () 

This should load all the mods, you want. If you want specific mods to be loaded then you can check them before loading:

local MyMods = { ["someMod1"] = true, ["someMod2"] = true, ["SomeOtherMod"] = true }
for i, v in pairs ( Downloader.Mods ) do 
   if MyMods[i] then
       Mods.SetModEnabled ( i, true );
   end
end 

 

Link to comment
On 20/07/2017 at 23:41, Saml1er said:

Create a new lua file -> Add it to meta.xml and set type to "client" -> add this code:


function LoadAllMods ()
    Inter.refresh ( );
  
    -- if player is in vehicle then don't load mods
    if ( localPlayer:getOccupiedVehicle ( ) ) then
       outputChatBox ( "Please exit your vehicle before enabling or disabling mods. Retrying in 15 seconds", 255, 255, 0 );
    
       -- retry in 15 seconds by calling the same function again
       setTimer (LoadAllMods, 15000,1)
       return false
    end
	
    -- download the mods
    for i, v in pairs ( Downloader.Mods ) do 
        Mods.SetModEnabled ( i, true );
    end 

    Inter.refresh ( );
    return true
end

LoadAllMods () 

This should load all the mods, you want. If you want specific mods to be loaded then you can check them before loading:


local MyMods = { ["someMod1"] = true, ["someMod2"] = true, ["SomeOtherMod"] = true }
for i, v in pairs ( Downloader.Mods ) do 
   if MyMods[i] then
       Mods.SetModEnabled ( i, true );
   end
end 

 

Not work :/ I want when a player login, turn all the mods automatically, that's what I need, a help please?

Link to comment

I made a one by the command, but I do not know how to make it with for example resourcestart or playerlogin..

help please?

addCommandHandler ( "turnmodson", function ( )
	if ( not Downloader.gotResponse ) then 
		outputChatBox ( "We're still waiting for the server to accept our request. Please wait", 255, 255, 0 );
		return false;
	end

			for i, v in pairs ( Downloader.Mods ) do 
				Mods.SetModEnabled ( i, true );
			end 
end );

 

Edited by TorNix~|nR
Link to comment

this is a client-side.

addCommandHandler ( "turnmodson", function ( )
	if ( not Downloader.gotResponse ) then 
		outputChatBox ( "We're still waiting for the server to accept our request. Please wait", 255, 255, 0 );
		return false;
	end

			for i, v in pairs ( Downloader.Mods ) do 
				Mods.SetModEnabled ( i, true );
			end 
end );

 

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