An issue with JSON I believe. I need to finish my rewrite. :/
Welcome Gifts [Unmaintained]
Discussion in 'Plugin Support' started by Wulf, Nov 1, 2014.
-
Wulf Community Admin
-
I got this today:
Code:[Oxide] 5:30 PM [Error] Failed to call hook 'OnPlayerInit' on plugin 'Welcome Gifts' File: welcomegifts.lua Line: 31 invalid arguments to method call: at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args) [0x00000] in <filename unknown>:0 at NLua.LuaFunction.Call (System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Ext.Lua.Plugins.LuaPlugin.OnCallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
-
I've been trying to fix this, the json seems to go crazy when you use a "."... tried rewriting from scratch as well with same result lol
[DOUBLEPOST=1439615274,1439453810][/DOUBLEPOST]I've updated this plugin if anyone is interested:
New config looks like:
Code:{ "Messages": { "GiftsGiven": "Welcome gift(s) given to {player}", "GiftsReceived": "Enjoy your welcome gift(s) {player}!", "InvalidItem": "{itemname} is not a valid item!" }, "Settings": { "ChatName": "Welcome Gifts", "ConfigVersion": "0.0.2", "Gifts": [ { "amount": 2, "name": "can.tuna" }, { "amount": 3, "name": "apple" }, { "amount": 3, "name": "lock.code BP" } ] } }
Attached Files:
-
-
an update planned?
-
How can I set this so that the "welcome gifts" are given on every respawn (after death)
-
Wulf Community Admin
-
Hi Wulf,
Another of the many great plugins you've created is this one - welcomegifts. I've had the following error message in RCON a few times (sorry I can't provide more info - I'm not sure if it's working or not, as I am not a new member to the server, and therefore don't receive the gifts):
Code:[Oxide] 12:01 AM [Error] Failed to call hook 'OnPlayerInit' on plugin 'welcomegifts v0.1.2' File: welcomegifts.lua Line: 31 invalid arguments to method call: at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args) [0x00000] in <filename unknown>:0 at NLua.LuaFunction.Call (System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Ext.Lua.Plugins.LuaPlugin.OnCallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
Last edited by a moderator: Aug 23, 2015 -
Wulf Community Admin
-
Hi Wulf,
You're correct the config file is likely the problem! One odd thing however - I just tested this a few times...
I edit the config file to look like this:
Code:{ "Messages": { "GiftsGiven": "Welcome gift(s) given to {player}", "GiftsReceived": "Enjoy your welcome gift(s) {player}!", "InvalidItem": "{itemname} is not a valid item!" }, "Settings": { "Gifts": { "apple": 5, "bandage": 3, "blueprint_fragment": 20, "can.tuna": 3, "spear.wooden": 1 } } }
Code:{ "Messages": { "GiftsGiven": "Welcome gift(s) given to {player}", "GiftsReceived": "Enjoy your welcome gift(s) {player}!", "InvalidItem": "{itemname} is not a valid item!" }, "Settings": { "Gifts": { "apple": 5, "bandage": 3, "blueprint_fragment": 20, "can": { "tuna": 3 }, "spear": { "wooden": 1 } } } }
-
Wulf Community Admin
-
Apologies Wulf, I didn't see that version when I first downloaded... :-$
-
already tried that version and it didnt work either, i have been trying this one, which also does not work.
Code:{ "Messages": { "GiftsGiven": "Welcome gift(s) given to {player}", "GiftsReceived": "Enjoy your welcome gift(s) {player}!", "InvalidItem": "{itemname} is not a valid item!" }, "Settings": { "ConfigVersion": "0.0.2", "Gifts": [ { "amount": 20, "name": "berries" }, { "amount": 3, "name": "apple" }, { "amount": 1, "name": "bow.hunting" }, { "amount": 40, "name": "arrow.hv" }, { "amount": 10, "name": "bandage" }, { "amount": 2, "name": "hatchet" }, { "amount": 1, "name": "jacket.snow3" }, { "amount": 1, "name": "shoes.boots" }, { "amount": 1, "name": "burlap.trousers" }, { "amount": 2, "name": "campfire" }, { "amount": 2, "name": "pickaxe" }, { "amount": 2, "name": "torch" } ] } }this is accepted as a valid json script but no one gets anything
Last edited by a moderator: Aug 25, 2015 -
Have my updated version.
Delete /config/welcomegifts.json & /data/welcomegifts.json before you run this. It'll probably work anyway, but just to be safe.
Also I added a command "/resetgifts" for people with level 2 auth level which just wipes the data file.
/data/welcomegifts.json will look like:
Code:{ "Count": 3, "Recipients": { "76561198078138369": { "Gifts": "bow.hunting, apple, blueberries, arrow.hv, bandage, hatchet, jacket.snow3, shoes.boots, burlap.trousers, campfire, pickaxe, torch" }, "76561198113096834": { "Gifts": "bow.hunting, apple, blueberries, arrow.hv, bandage, hatchet, jacket.snow3, shoes.boots, burlap.trousers, campfire, pickaxe, torch" }, "76561198205569597": { "Gifts": "bow.hunting, apple, blueberries, arrow.hv, bandage, hatchet, jacket.snow3, shoes.boots, burlap.trousers, campfire, pickaxe, torch" } } }
Code:{ "Messages": { "GiftsGiven": "Welcome gift(s) given to {player}", "GiftsReceived": "Enjoy your welcome gift(s) {player}!", "InvalidItem": "{itemname} is not a valid item!" }, "Settings": { "AuthLevel": 2, "ChatName": "Welcome Gifts", "ConfigVersion": "0.0.2", "FirstUse": false, "Gifts": [ { "amount": 1, "name": "bow.hunting" }, { "amount": 3, "name": "apple" }, { "amount": 20, "name": "blueberries" }, { "amount": 40, "name": "arrow.hv" }, { "amount": 10, "name": "bandage" }, { "amount": 2, "name": "hatchet" }, { "amount": 1, "name": "jacket.snow3" }, { "amount": 1, "name": "shoes.boots" }, { "amount": 1, "name": "burlap.trousers" }, { "amount": 2, "name": "campfire" }, { "amount": 2, "name": "pickaxe" }, { "amount": 2, "name": "torch" } ] } }
Attached Files:
Last edited by a moderator: Aug 25, 2015 -
-
Hello can someone help me with plugins because im put 4 plugins and none not working oxide im upgrade to last wersion,or just plugins not working because there need change .lua .cs .json im Download plugins example welcomegifts.lua and im put in config folder the same welcomegifts.lua! there need change something?? in config folder i hewe .py .cs .lua!!
-
Wulf Community Admin
-
-
Wulf Community Admin
-
-
Wulf Community Admin