I'll be posting my questions in this Thread so I don't flood the forum.
I'm working on making the plugin that I suggested here:
I'm currently Stuck on a problem of trying to call a hook from a different plugin. I'm using ZoneManger to create and handle the zones. http://oxidemod.org/plugins/zones-manager.739/
After using the chat command to call the function above I get the Error below. Line 60 is the line with "util.TableToArray(zoneArgs)"Code:function PLUGIN:cmdSetProtected(player) rust.SendChatMessage(player, "NOR-Plugin", "Set Protected Command(test)") if not plugins.Exists( "ZoneManager" ) then rust.SendChatMessage(player, "NOR-Plugin", "ZoneManager Plugin Not Found!") return end --bool CreateOrUpdateZone(string ZoneID, string[] args, Vector3 position = default(Vector3)) rust.SendChatMessage(player, "NOR-Plugin", "Createing protected Zone for " .. tostring(player.name)) local ZoneID = "Test" local zoneArgs = {} zoneArgs[0] = "name" zoneArgs[1] = "Test" zoneArgs[2] = "enter_message" zoneArgs[3] = "Test Zones!" zoneArgs[4] = "radius" zoneArgs[5] = "120" if not plugins.CallHook("CreateOrUpdateZone", ZoneID, util.TableToArray(zoneArgs), player.transform.position) then rust.SendChatMessage(player, "NOR-Plugin", "Created Zone - FAILED") return else rust.SendChatMessage(player, "NOR-Plugin", "Created Zone - Zone id= " .. tostring(player)) end end
Anyways I feel like it's a syntax problem but I'm not familiar enough with LUA, etc to notice what exactly.Code:[Oxide] 7:50 PM [Error] Failed to call hook 'cmdSetProtected' on plugin 'No Offline Raiding' File: NoOfflineRaid.lua Line: 60 Specified table is not an array: at Oxide.Ext.Lua.Libraries.LuaUtil.TableToArray (NLua.LuaTable table) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Any help anyone can provide would be awesome.
Thanks!
No offline raiding, dev questions (Lua)
Discussion in 'Rust Development' started by Attckdog, May 30, 2015.