Snakeman Posted December 22, 2016 Share Posted December 22, 2016 Well i tried with this code but nothing happens... Mi still nil ... :/ MI = nil; local mod = getModInfo("mods/morefishingitems/mod.info"); if mod and mod:getId() == "morefishingitems" and mod:isModActive() then MI = true; end Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted December 22, 2016 Share Posted December 22, 2016 (edited) Haven´t tested it, but something like this might work: local actmods = getActivatedMods(); local MI = false; for i=0, actmods:size(), 1 do if actmods:get(i) == "morefishingitems" then MI=true; break; end end Edited December 22, 2016 by Dr_Cox1911 Snakeman 1 Link to comment Share on other sites More sharing options...
Snakeman Posted December 22, 2016 Author Share Posted December 22, 2016 Thanks a lot!! Working Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted December 22, 2016 Share Posted December 22, 2016 Glad that it worked, but I forgot a "break" in there (no need to iterate over the rest of the array if you already found the mod). I edited the above post to reflect that change. Snakeman 1 Link to comment Share on other sites More sharing options...
nolanri Posted February 5, 2017 Share Posted February 5, 2017 (edited) its should be for i=0, actmods:size()-1, 1 do Here is my function to check if a mod is enabled: function isModEnabled(modname) local actmods = getActivatedMods(); for i=0, actmods:size()-1, 1 do if actmods:get(i) == modname then return true; end end return false; end Edited February 5, 2017 by nolanri Link to comment Share on other sites More sharing options...
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