Reneb submitted a new resource:
Give - Give a player or yourself
Read more about this resource...
Give
Moved
Total Downloads: 21,434 - First Release: Oct 21, 2014 - Last Update: Mar 9, 2017
- 5/5, 35 likes
-
Wow Reneb! Thanks so much!
-
Reneb updated Give with a new update entry:
all items all the time
-
-
Nice thank you, you're doing alot today btw ^^
-
Your code example was perfect for what I needed. Thanks a lot Reneb!
-
Has errors while loading give and tphome
6:39 PM [Error] Failed to initialise plugin give (NullReferenceException: Object reference not set to an instance of an object)
6:39 PM [Debug] at ItemManager.GetItemDefinitions () [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
6:39 PM [Error] Failed to initialise plugin tphome (ArgumentException: An element with the same key already exists in the dictionary.)
6:39 PM [Debug] at System.Collections.Generic.Dictionary`2[System.String,Oxide.Rust.Libraries.Command+ChatCommand].Add (System.String key, ChatCommand value) [0x00000] in <filename unknown>:0
at Oxide.Rust.Libraries.Command.AddChatCommand (System.String name, Oxide.Core.Plugins.Plugin plugin, System.String callbackname) [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 -
Code:
function PLUGIN:cmdKit ( player, cmd, args ) self.Table = {} local itemlist = global.ItemManager.GetItemDefinitions(); local it = itemlist:GetEnumerator() while (it:MoveNext()) do local correctname = string.lower(it.Current.displayname,"%%","t") self.Table[correctname] = tostring(it.Current.shortname) self.Table[correctname].itemid = tostring(it.Current.itemid) end local targetinv = player.inventory local prefMain = targetinv.containerMain; local giveitem = global.ItemManager.CreateByName( "wood", 3000 ) targetinv:GiveItem ( giveitem, prefMain ); local prefWear = targetinv.containerWear; giveitem = global.ItemManager.CreateByName( "burlap_trousers", 1 ) targetinv:GiveItem ( giveitem, prefWear ); local prefBelt = targetinv.containerBelt; giveitem = global.ItemManager.CreateByName( "stonehatchet", 1 ) targetinv:GiveItem ( giveitem, prefBelt ); end
-
Reneb updated Give with a new update entry:
plugin working only after server started
-
Im finding that a lot of the resources is coming up and saying not valid.
-
If you get 1 valid resource then it's because you dont write the rest Well.
If it's not working at all, then just reload the plugin (normally you shouldnt have to) -
seem to be getting this error when i try to give a player something
Code:[Oxide] 6:43 PM [Error] give: [string "give.lua"]:81: attempt to index global 'playerplayer' (a nil value) 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 (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
-
Code:
playerplayer:ChatMessage("You have received " .. tostring(amount) .. "x " .. string.lower(args[1]))
Code:targetplayer:ChatMessage("You have received " .. tostring(amount) .. "x " .. string.lower(args[1]))
Last edited by a moderator: Oct 23, 2014 -
Dat fail --'
I'll fix that tonight -
thanks guys!
Just noticed that when giving a player something, they dont receive the message saying they received it seems to come to the person doing the command. -
How do I give myself cooked chicken ? /give name cooked chicken 1 doesnt seem to work
-
/give wolfmeat_cooked 1
Check this site out, it has all the correct names
http://radmin.elasticbeanstalk.com/item/list/approved/consumable/ -
Okay so the list must be wrong with a lot of items because bear meat is not an item yet bearmeat is an item, must be a trial and error[DOUBLEPOST=1414059323][/DOUBLEPOST]Okay so thats a bug eating the pile eats the lot lol thank you prawin
-
No it's because you need to pût "
/give "Cooked Chicken" 1