• InventoryAddon
    197 replies, posted
Did anyone figure out how to make it bind to a key when people join so they only have to hit F5 without having to bind it?
[QUOTE=stapled;16572241]thanks for the info on the "F" keys :D can you find away to use this with darkrps entities?[/QUOTE] Possible. If you want to use it for guns make an item. Example: weapon_m4a1_example [lua] local ITEM = { } ITEM.UniqueID = "m4a1" ITEM.Model = "models/weapons/w_rif_m4a1.mdl" ITEM.Name = "Colt M4A1" ITEM.Description = "Colt M4A1" ITEM.RemoveOnUse = true if ( SERVER ) then function ITEM:USE( ply ) if ply:GetWeapon("weapon_m4a1") then ply:GiveAmmo(100,"rifle"); Inventory:SendMessage( "You already have a Colt M4A1", ply, false ) else ply:Give("weapon_m4a1"); Inventory:SendMessage( "You have given a Colt M4A1", ply, false ) end end end Inventory:RegisterItem( ITEM ) [/lua] Haven't tested it but, I'm sure it works.
It should definitely work.
[QUOTE=yahan;16606522]Possible. If you want to use it for guns make an item. Example: weapon_m4a1_example [lua] local ITEM = { } ITEM.UniqueID = "m4a1" ITEM.Model = "models/weapons/w_rif_m4a1.mdl" ITEM.Name = "Colt M4A1" ITEM.Description = "Colt M4A1" ITEM.RemoveOnUse = true if ( SERVER ) then function ITEM:USE( ply ) if ply:GetWeapon("weapon_m4a1") then ply:GiveAmmo(100,"rifle"); Inventory:SendMessage( "You already have a Colt M4A1", ply, false ) else ply:Give("weapon_m4a1"); Inventory:SendMessage( "You have given a Colt M4A1", ply, false ) end end end Inventory:RegisterItem( ITEM ) [/lua] Haven't tested it but, I'm sure it works.[/QUOTE] yes thats works but when you buy a shipment it doesn't count as an inventory addon entity
I am making a gamemode, and I made a inventory almost the same as this one only this is more advanced, can I intergrate this one in my gamemode and give you credits ?
use it how you want, i dont care.
Hey chew make a table with SteamIDs that allow people to use the +admininventorymenu or whatever please.
ima improve this soon
[QUOTE=stapled;16615766]yes thats works but when you buy a shipment it doesn't count as an inventory addon entity[/QUOTE] Please explain. I'm having trouble what you are trying to say.
Shipments don't actually buy weapon_'s in DarkRp, it buys entities that have the same model but give you the weapon on use. What I assume he wants is that when you use the entities that are the model of the weapon it will give you the weapon in your InventoryAddon menu.
[QUOTE=SaltyPeppr;16656487]Shipments don't actually buy weapon_'s in DarkRp, it buys entities that have the same model but give you the weapon on use. What I assume he wants is that when you use the entities that are the model of the weapon it will give you the weapon in your InventoryAddon menu.[/QUOTE] yeah i want to be able to take the weapons from the shipment and be able to store them in the inventory
That would be tricky. Not really all you would have to do is edit the weapon's shared.
[QUOTE=Killer_Steel;16556999]Interesting, seems a lot like the inventory system from CakeScript, only an addon :D, cool.[/QUOTE] There's not much you can do that makes one inventory different from another, they all do the same thing and add items similarly. Either text files or functions.
I'm currently using this addon on my server, and I must say it's working perfectly and it's very well done, but I only have one problem and was wondering if you could help me. Whenever a player spawns or drops an item, the console gets spammed with about ten lines of this. "entities/inventoryaddon_item/cl_init.lua:4: attempt to call method 'DrawEntityOutline' (a nil value)" And the model of the item on the ground is invisible. It can still be picked up and it still displays the name if you look at its shadow, but you can't see it. Does anyone know how to fix this? Any help would be greatly appreciated.
^, I think you must derive sandbox cuz its using the base_gmodentity thingy. Will fix that in next version though.
Can we add things like SWEPS and Entities to the inventory?
Can you use this on anyones server or do thay have to have it aswhel ???
So ChewGum, how do we make an item use features, like, I wanted to make an item that on use it would increase your speed a bit.
[QUOTE='[CIA] ZOmBine;16736803']So ChewGum, how do we make an item use features, like, I wanted to make an item that on use it would increase your speed a bit.[/QUOTE] Uh... I wonder what the item:USE function is used to... /sarcasm
[QUOTE=Capsup;16736872]Uh... I wonder what the item:USE function is used to... /sarcasm[/QUOTE] Well, I'm sorry it's just that I don't do alot of coding so I kinda wanted some help :(. Like it would make your speed a little faster than normal sprint speed and make it count as you pressing your sprint key so you can't go faster than that. Also have it like, wear out after 5 seconds. [b]Edit:[/b] I don't really know what I would put after item:USE ( ply ) :P
[QUOTE=SaltyPeppr;16494507]Open a new wordpad/notepad document and copy&paste the code into it, make the name whatever you want, but after the name you MUST include the .lua extension. So if I named it hotkeymenu it will look like hotkeymenu.lua Then, put hotkeymenu.lua (or whatever you named it) into your garrysmod/garrysmod/lua/autorun/server folder. Then push F4 in-game (duhrr) and it should work. For a gamemode, you'll just need to copy and paste the code into the init.lua file in the gamemode's main folder, somewhere near the bottom.[/QUOTE] where is the path???? i can't find the path
[QUOTE=wwemangarrys;16737234]where is the path???? i can't find the path[/QUOTE] [quote]garrysmod/garrysmod/lua/autorun/server[/quote] Seriously... It's right in the post you quoted.
[QUOTE='[CIA] ZOmBine;16737143']Well, I'm sorry it's just that I don't do alot of coding so I kinda wanted some help :(. Like it would make your speed a little faster than normal sprint speed and make it count as you pressing your sprint key so you can't go faster than that. Also have it like, wear out after 5 seconds. [b]Edit:[/b] I don't really know what I would put after item:USE ( ply ) :P[/QUOTE] [lua] local num = 250 -- Change this, 250 is default walk speed. ply:SetWalkSpeed(num) ply:SetRunSpeed(num * 2) [/lua]
Didn't wolly already make something like this for haloRP?
Hem, i prefer Item forge, Sure it is a little more Complicated but it's better.
[QUOTE=ChewGum;15612897]Thanks, if you have any suggestions or questions, please post them.[/QUOTE] You should make a locker do the same thing.
ChewGum this was pretty ingenious of you :D you took something that's been done so many times, and just removed the bloat. I'm not being sarcastic, it was a good idea.
Well, since my main is banned olollo im on this. I tested some new shit yesterday, the new item creation tracks the models instead and inserts info so it's pretty much easier to make items and make everything a item, though I don't know if there will be any downsides to it... going to release soon so grab it and test it if you want. Though all your previous items will be lost and ur data since it's a new system.
Dude you can wear rebel clothes? drink beer? and get health kits??? this is epic
[QUOTE=20 Smartness;16738048][lua] local num = 250 -- Change this, 250 is default walk speed. ply:SetWalkSpeed(num) ply:SetRunSpeed(num+100) [/lua][/QUOTE] That'd be better.
Sorry, you need to Log In to post a reply to this thread.