I'm trying to grab a list of loaded plugins and their name and version. I know this is exactly what PluginList by Wulf does, but it's in LUA and I absolutely hate LUA, and I can't seem to translate it into working C#. I think my main issue is not knowing what types variables are.
Here is the pertinent LUA code from PluginList.lua
[DOUBLEPOST=1439153793,1439097557][/DOUBLEPOST]Anyone?Code:local pluginList, pluginTable = plugins.GetAll(), {} local title, version, description, resourceId if args.Length ~= 1 then for i = 2, pluginList.Length - 1 do title = pluginList[i].Title version = pluginList[i].Version:ToString() description = pluginList[i].Description resourceId = pluginList[i].Object.ResourceId pluginTable[i - 1] = title end local message = table.concat(pluginTable, ", ") SendChatMessage(player, messages.InstalledPlugins .. " " .. message) end
C#: Grabbing List of Plugins, their name, and their version
Discussion in 'Rust Development' started by AnExiledGod, Aug 9, 2015.
-
Wulf Community Admin
You could take a look at how Oxide does it with its own plugins console command.
https://github.com/OxideMod/Oxide/blob/master/Oxide.Game.Rust/RustCore.cs#L182 -
Oh, I didn't even know that was a console command. Thank you!
