[QUOTE=Jawalt;16748467]That'd be better.[/QUOTE]
According to the Wiki, by default, run is twice as fast as walk.
This is getting some attention.
If people want to know how to make weapons into items: [url]http://www.facepunch.com/showpost.php?p=16749935&postcount=2[/url]
[QUOTE=20 Smartness;16749938]If people want to know how to make weapons into items: [url]http://www.facepunch.com/showpost.php?p=16749935&postcount=2[/url][/QUOTE]
Yeah I already mention something like your's before on page two of this thread.
[url]http://www.facepunch.com/showpost.php?p=16606522&postcount=62[/url]
OK, so this is the new system and I updated the menu some. No download yet since i'm not quite done yet.
I can only think of 1 thingy bout this new stuff is that you can't use the same model twice for 2 items.
Here are some examples of items creation:
[lua]
Template:
InventoryAddon:NewItem( Name, Description, Model, RemoveOnUse, UseAble, UseSound, Function )
- UseAble: Is it useable in the item menu?
- UseSound: The sound that will be played when you use the item, if you dont want any just put nil there.
- RemoveOnUse: Will the item be removed from your inventory when used?
- Model: This is the unique thing about the item.
Examples:
InventoryAddon:NewItem( "Healthkit", "Gives you 100 health.", "models/Items/healthkit.mdl", true, true, "items/medshot4.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 50 ) end )
InventoryAddon:NewItem( "Bleach", "DON'T DRINK IT! IT WILL KILL YOU!!.", "models/props_junk/garbage_plasticbottle001a.mdl", true, true, "ambient/voices/cough4.wav", function( Entity ) timer.Simple( 1, function( Entity ) Entity:Kill() end, Entity ) end )
InventoryAddon:NewItem( "Soda", "Yum", "models/props_junk/PopCan01a.mdl", true, true, "ambient/water/water_spray1.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 15 ) end )
[/lua]
Pic of new inventory design:
[URL=http://img43.imageshack.us/i/newinventory.png/][IMG]http://img43.imageshack.us/img43/8646/newinventory.th.png[/IMG][/URL]
i take it all the green text isn't supposed to be there.
1. -- This particular items table, must have it.
2. local ITEM = { }
3.
4. -- The UniqueID for this item, this is used to spawn the item and it's the ID for the item. Text always has to be lowered.
5. ITEM.UniqueID = "example"
6.
7. -- The model that will be shown in the inventory and on the map.
8. ITEM.Model = "models/props_junk/shoe001a.mdl"
9.
10. -- The name for this item, used in the inventory menu.
11. ITEM.Name = "Example"
12.
13. -- The description for this item, used in the inventory menu.
14. ITEM.Description = "A example item"
15.
16. -- Remove this item from the inventory when you press use on it?
17. -- True will make it remove, false will make it stay.
18. ITEM.RemoveOnUse = true
19.
20. -- The USE item function.
21. if ( SERVER ) then -- Only used on server so use this check.
22. function ITEM:USE( ply )
23. InventoryAddon:SendMessage( "You used the Example item", ply, false )
24. end
25. end
26.
27. -- Register the item so it exists in the main stuff.
28. InventoryAddon:RegisterItem( ITEM )
Hello my name is Alex Meanberg member of the hl2reality dev team.
This inventory addon has been copied from GModRP made by hl2reality which has been released 1 month ago before this. Just download GModRP and compare it's inventory code with this one.
Chewgum's Inventory Code:
[lua]
-- This particular items table, must have it.
local ITEM = { }
-- The UniqueID for this item, this is used to spawn the item and it's the ID for the item. Text always has to be lowered.
ITEM.UniqueID = "example"
-- The model that will be shown in the inventory and on the map.
ITEM.Model = "models/props_junk/shoe001a.mdl"
-- The name for this item, used in the inventory menu.
ITEM.Name = "Example"
-- The description for this item, used in the inventory menu.
ITEM.Description = "A example item"
-- Remove this item from the inventory when you press use on it?
-- True will make it remove, false will make it stay.
ITEM.RemoveOnUse = true
-- The USE item function.
if ( SERVER ) then -- Only used on server so use this check.
function ITEM:USE( ply )
InventoryAddon:SendMessage( "You used the Example item", ply, false )
end
end
-- Register the item so it exists in the main stuff.
InventoryAddon:RegisterItem( ITEM )[/lua]
Gmodrp's Inventory Code
[lua]
local ITEM = {}
ITEM.ID = "airboat"
ITEM.Name = "Airboat"
ITEM.Price = 300
ITEM.Info = "An airboat."
ITEM.Type = "vehicle"
ITEM.Remove = false
ITEM.Energy = 0
ITEM.Model = "models/airboat.mdl"
ITEM.Permit = "vehicleselling"
function ITEM.Spawn( p )
GMRP.BaseVehicle( p, "models/airboat.mdl", "prop_vehicle_airboat", "scripts/vehicles/airboat.txt", ITEM )
end
function ITEM.Use( p, ent )
end
GMRP.AddItem( ITEM )
[/lua]
For more proof download the code of gmod.org
[url=http://www.garrysmod.org/downloads/?a=view&id=70734][img]http://www.garrysmod.org/img/?t=dll&id=70734[/img][/url]
[url=http://www.garrysmod.org/downloads/?a=view&id=69735][img]http://www.garrysmod.org/img/?t=dll&id=69735[/img][/url]
Keep in mind GmodRP Is licenced by creative commons
[img]http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png[/img]
Yeah too bad that it's such a generic script that it's just a coincidence. I had almost the same thing a while ago.
Direct rip off of every single other item system in GMod using the same ITEM. and same event names, just more of the same and the inventory menu is so laughable.
Agree with both posts above mine... This is a direct ripoff of every other system whether it was pulled directly or not and the new inventory system is still terrible and reminds me of maurits150's inventory tbh.
yup, i stole from every other script in gmod im sry sue me already
GmodRP omg stolez that code frum Cake omg!
Cakescript - Over a year ago
[lua]
ITEM.Name = "Refried Beans";
ITEM.Class = "beans";
ITEM.Description = "It expired a month ago..";
ITEM.Model = "models/props_junk/garbage_metalcan001a.mdl";
ITEM.Purchaseable = true;
ITEM.Price = 3;
ITEM.ItemGroup = 1;
function ITEM:Drop(ply)
end
function ITEM:Pickup(ply)
self:Remove();
end
function ITEM:UseItem(ply)
ply:ConCommand("say /me eats some refried beans");
self:Remove();
end
[/lua]
GmodRP - Like a month ago.
[lua]
local ITEM = {}
ITEM.ID = "airboat"
ITEM.Name = "Airboat"
ITEM.Price = 300
ITEM.Info = "An airboat."
ITEM.Type = "vehicle"
ITEM.Remove = false
ITEM.Energy = 0
ITEM.Model = "models/airboat.mdl"
ITEM.Permit = "vehicleselling"
function ITEM.Spawn( p )
GMRP.BaseVehicle( p, "models/airboat.mdl", "prop_vehicle_airboat", "scripts/vehicles/airboat.txt", ITEM )
end
function ITEM.Use( p, ent )
end
GMRP.AddItem( ITEM )
[/lua]
Get out.
[editline]01:03AM[/editline]
[QUOTE=20 Smartness;16749829]According to the Wiki, by default, run is twice as fast as walk.[/QUOTE]
And it's going to become rediculously fast if you do that with higher numbers.
[QUOTE=NotAlt;16752426]OK, so this is the new system and I updated the menu some. No download yet since i'm not quite done yet.
I can only think of 1 thingy bout this new stuff is that you can't use the same model twice for 2 items.
Here are some examples of items creation:
[lua]
Template:
InventoryAddon:NewItem( Name, Description, Model, RemoveOnUse, UseAble, UseSound, Function )
- UseAble: Is it useable in the item menu?
- UseSound: The sound that will be played when you use the item, if you dont want any just put nil there.
- RemoveOnUse: Will the item be removed from your inventory when used?
- Model: This is the unique thing about the item.
Examples:
InventoryAddon:NewItem( "Healthkit", "Gives you 100 health.", "models/Items/healthkit.mdl", true, true, "items/medshot4.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 50 ) end )
InventoryAddon:NewItem( "Bleach", "DON'T DRINK IT! IT WILL KILL YOU!!.", "models/props_junk/garbage_plasticbottle001a.mdl", true, true, "ambient/voices/cough4.wav", function( Entity ) timer.Simple( 1, function( Entity ) Entity:Kill() end, Entity ) end )
InventoryAddon:NewItem( "Soda", "Yum", "models/props_junk/PopCan01a.mdl", true, true, "ambient/water/water_spray1.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 15 ) end )
[/lua]
Pic of new inventory design:
[URL=http://img43.imageshack.us/i/newinventory.png/][IMG]http://img43.imageshack.us/img43/8646/newinventory.th.png[/IMG][/URL][/QUOTE]
:D cant wait for it
making items seems a lot easier now
[QUOTE=yahan;16750964]Yeah I already mention something like your's before on page two of this thread.
[url]http://www.facepunch.com/showpost.php?p=16606522&postcount=62[/url][/QUOTE]
Sorry, didn't see that.
[QUOTE=ameanberg;16758655]Hello my name is Alex Meanberg member of the hl2reality dev team.
This inventory addon has been copied from GModRP made by hl2reality which has been released 1 month ago before this. Just download GModRP and compare it's inventory code with this one.
Chewgum's Inventory Code:
[lua]
-- This particular items table, must have it.
local ITEM = { }
-- The UniqueID for this item, this is used to spawn the item and it's the ID for the item. Text always has to be lowered.
ITEM.UniqueID = "example"
-- The model that will be shown in the inventory and on the map.
ITEM.Model = "models/props_junk/shoe001a.mdl"
-- The name for this item, used in the inventory menu.
ITEM.Name = "Example"
-- The description for this item, used in the inventory menu.
ITEM.Description = "A example item"
-- Remove this item from the inventory when you press use on it?
-- True will make it remove, false will make it stay.
ITEM.RemoveOnUse = true
-- The USE item function.
if ( SERVER ) then -- Only used on server so use this check.
function ITEM:USE( ply )
InventoryAddon:SendMessage( "You used the Example item", ply, false )
end
end
-- Register the item so it exists in the main stuff.
InventoryAddon:RegisterItem( ITEM )[/lua]
Gmodrp's Inventory Code
[lua]
local ITEM = {}
ITEM.ID = "airboat"
ITEM.Name = "Airboat"
ITEM.Price = 300
ITEM.Info = "An airboat."
ITEM.Type = "vehicle"
ITEM.Remove = false
ITEM.Energy = 0
ITEM.Model = "models/airboat.mdl"
ITEM.Permit = "vehicleselling"
function ITEM.Spawn( p )
GMRP.BaseVehicle( p, "models/airboat.mdl", "prop_vehicle_airboat", "scripts/vehicles/airboat.txt", ITEM )
end
function ITEM.Use( p, ent )
end
GMRP.AddItem( ITEM )
[/lua]
For more proof download the code of gmod.org
[url=http://www.garrysmod.org/downloads/?a=view&id=70734][img]http://www.garrysmod.org/img/?t=dll&id=70734[/img][/url]
[url=http://www.garrysmod.org/downloads/?a=view&id=69735][img]http://www.garrysmod.org/img/?t=dll&id=69735[/img][/url]
Keep in mind GmodRP Is licenced by creative commons
[img]http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png[/img][/QUOTE]
I suggest you speak with slob.
He doesn't think it's copied.
[QUOTE=ChewGum;15609771]InventoryAddon is a addon that allows you to use a inventory with a item system that I provided.
This isn't roleplay specific use, it can be used in any gamemode.
[B][u]Information[/u][/B]
Inventory data saves on disconnect.
You can toggle the addon to be active or not in the autorun/loader.lua
[B][u]Ingame Use[/u][/B]
Open your console and type: 'bind <key> +inventoryaddonmenu'
Admins has a spawn item menu which you can type in console to open it: 'adminitemmenu'
[B][u]How to create a item[/u][/B]
[release]
[lua]
-- This particular items table, must have it.
local ITEM = { }
-- The UniqueID for this item, this is used to spawn the item and it's the ID for the item. Text always has to be lowered.
ITEM.UniqueID = "example"
-- The model that will be shown in the inventory and on the map.
ITEM.Model = "models/props_junk/shoe001a.mdl"
-- The name for this item, used in the inventory menu.
ITEM.Name = "Example"
-- The description for this item, used in the inventory menu.
ITEM.Description = "A example item"
-- Remove this item from the inventory when you press use on it?
-- True will make it remove, false will make it stay.
ITEM.RemoveOnUse = true
-- The USE item function.
if ( SERVER ) then -- Only used on server so use this check.
function ITEM:USE( ply )
InventoryAddon:SendMessage( "You used the Example item", ply, false )
end
end
-- Register the item so it exists in the main stuff.
InventoryAddon:RegisterItem( ITEM )
[/lua]
[B]
Then you save the item to a file like this, 'thisitemsname.lua' in the items folder.[/B]
[/release]
[B]
Download:[/B]
[url=http://www.garrysmod.org/downloads/?a=view&id=70734][img]http://www.garrysmod.org/img/?t=dll&id=70734[/img][/url]
Put it in addons.
[u]Sorry if I forgot anything. Ask any questions you want.[/u][/QUOTE]
I binded it to B,i hit B,and it said unknown command,i tried it without the plus,with sv_cheats on and off..still nothing!HALP
oh good someone else is having this problem too,good,im not alone lol.
Anyone wanna help me out?
Oh, and heya Chew.
Either you still hate me or don't remember me;
I was that shitty admin on your server.
Long time no see :P
[QUOTE=Thundercock;16783572]Oh, and heya Chew.
Either you still hate me or don't remember me;
I was that shitty admin on your server.
Long time no see :P[/QUOTE]
I don't remember you.
I have read everything here, And I'm not sure how to do this still.
I'm trying to make it (In DarkRP) where gun dealers/medics can spawn the items I made.
I tried using the addshipment thing, but It just doesn't appear to work, It just spawns props.
AddCustomShipment("Frogvenom", "models/props_c17/TrapPropeller_Lever.mdl", "frogvenom", 1000, 10, false, 200, false, {TEAM_GUN, TEAM_MEDIC})
It says to put the spawned thing in the 3rd variable, But it just spawns the prop lever, How do I get it to spawn the Item from the Inventory addon?
Inventory Addon Items are not entities. You can't spawn an item from inventory addon. The only solution to your problem is to create an entity without inventory addon's help.
Well that kinda defeats the purpose of the addon then... Alright thank you.
[QUOTE=NotAlt;16752426]OK, so this is the new system and I updated the menu some. No download yet since i'm not quite done yet.
I can only think of 1 thingy bout this new stuff is that you can't use the same model twice for 2 items.
Here are some examples of items creation:
[lua]
Template:
InventoryAddon:NewItem( Name, Description, Model, RemoveOnUse, UseAble, UseSound, Function )
- UseAble: Is it useable in the item menu?
- UseSound: The sound that will be played when you use the item, if you dont want any just put nil there.
- RemoveOnUse: Will the item be removed from your inventory when used?
- Model: This is the unique thing about the item.
Examples:
InventoryAddon:NewItem( "Healthkit", "Gives you 100 health.", "models/Items/healthkit.mdl", true, true, "items/medshot4.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 50 ) end )
InventoryAddon:NewItem( "Bleach", "DON'T DRINK IT! IT WILL KILL YOU!!.", "models/props_junk/garbage_plasticbottle001a.mdl", true, true, "ambient/voices/cough4.wav", function( Entity ) timer.Simple( 1, function( Entity ) Entity:Kill() end, Entity ) end )
InventoryAddon:NewItem( "Soda", "Yum", "models/props_junk/PopCan01a.mdl", true, true, "ambient/water/water_spray1.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 15 ) end )
[/lua]
Pic of new inventory design:
[URL=http://img43.imageshack.us/i/newinventory.png/][IMG]http://img43.imageshack.us/img43/8646/newinventory.th.png[/IMG][/URL][/QUOTE]
You should make an extra option,"Use","Drop Item","Drop all",when you drop all (eg, an item that has 5 of count) it will spawn only a sent,but when you pick it up it will give you 5 of that item.
So one box containing multiple items. That's a good idea.
Any news as of late?
hmm, in the new version anyone can just spawn the item from the Q menu prop menu. Though do ya'll want the admin item menu still there or something?
I've also made a menu speificly for darkrp, though it gets a little lag when you open the menu if you have many items cuz the darkrp menu system sucks.
[QUOTE=ChewGum;16958574]hmm, in the new version anyone can just spawn the item from the Q menu prop menu. Though do ya'll want the admin item menu still there or something?
I've also made a menu speificly for darkrp, though it gets a little lag when you open the menu if you have many items cuz the darkrp menu system sucks.[/QUOTE]
Thanks =D Need it testing? :P
Update.
[QUOTE=ChewGum;16962025]Update.[/QUOTE]
where do we add items lmao xD
[QUOTE=stapled;16977410]where do we add items lmao xD[/QUOTE]
[QUOTE=ChewGum;15609771]Last Update: 27/08/09
[B]The item adding is at the bottom of IA_shared.lua[/B]
[/QUOTE]
.
This is great, the first time I have ever been able to add somethings in rather than trying to search for some because the LUA is too complicated :D
Hehe. Im still a fresh noob here. But im still trying to understand how to put the item into the inventory.
Do i add the code:
"InventoryAddon:NewItem( "Healthkit", "Gives you 100 health.", "models/Items/healthkit.mdl", true, true, "items/medshot4.wav", function( Entity ) Entity:SetHealth( Entity:Health() + 50 ) end )
"
In a new file and put it in the folder?
Does placing the Inventory addon in addons a bad thing? [I know, its obvious but just incase]
Do i just walk up to the prob and press the used button to put it in my inventory?
Do i need to put the code into the Command console?
Do i bring up the menu, hold the left clicker onto the spawned prop [If it is in sight] and drag and drop it into the menu? You know, when i do so, it has a little transparent small icon of the prop under the mouse meaning its being dragged. And then drop it into the inventory on display?
Or am i HORRIBLY off course?
Hm... Do i add the code around something in the code. Im thinking of adding it under:
"-- Main addon table.
InventoryAddon = { }
-- Items table.
InventoryAddon.Items = { }"
Or somewhere in it to make it work...
Complicated or simple... I aint a code expert. I cant make any heads or tails of this. maybe there should of been "Literal and specific to a fault" Step-by-step instructions on how to use it, but that is me. xD
So far when i try to pick it up, i get:
Hook 'InventoryAddonPickupItem' Failed: IA_init.lua:57: attempt to index field 'InventoryAddon' (a nil value)
either i have too many addons or its the case of a bug or something not processing properly.
EDIT:
Got it working but now its a addon or i got too much in me addon folder.
So your addon doesnt agree with another somewhere. Cause its saying:
Hook 'LoadInventoryData' Failed: IA_init.lua:89: bad argument #1 to 'pairs' (table expected, got nil)
Anyway folks, just to be frank: you use the "Use" button [E] and the prop of the health kit or such goes into your inventory, this is said just to clarify things.
Anyway. Im gonna see what does agree with it. and what does not and learn to live without it.
Sorry, you need to Log In to post a reply to this thread.