DarkRP Purchasable Armour?

Generally, I tend to get whatever custom content I can from the steam workshop for my DarkRP server. I haven’t however been able to find any sort of items that give players armour upon picking it up. I have seen other servers use entities like combine orbs to act as armour sets.

My question is if anybody knows some workshop items I may be looking for, or if there is a way to simply create my own. Ideally, the final product I want is medics having the ability to sell Full Armour sets (giving the player 100 Armour), and Armour pieces (giving the player 20 armour per piece).

SetArmor( 100 )

Where and how would I apply this? (don’t know too much about lua)

[lua]

function ENT:Use(activator,caller)
activator:SetArmor( 100 )
self:Remove()
end

[/lua]

Go into DarkRP/entities/entities/
copy one folder, rename it to “armor”.

cl_init.lua:



include("shared.lua")

function ENT:Draw()
	self:DrawModel()
end


shared.lua:



ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Armor"
ENT.Author = "Blabla"
ENT.Spawnable = false
ENT.AdminSpawnable = false


init.lua:



AddCSLuaFile("cl_init.lua");
AddCSLuaFile("shared.lua");

include("shared.lua");

function ENT:Initialize()
	self:SetModel( "models/props_interiors/BathTub01a.mdl" );
	self:PhysicsInit( SOLID_VPHYSICS );
	self:SetMoveType( MOVETYPE_VPHYSICS );
	self:SetSolid( SOLID_VPHYSICS );
	self:SetUseType( SIMPLE_USE );

	self:SetCollisionGroup( COLLISION_GROUP_INTERACTIVE_DEBRIS );
	local phys = self:GetPhysicsObject();

	phys:Wake();
	hook.Add( "PlayerDisconnected", self, self.onPlayerDisconnected );
end


function ENT:Use(ply)

	ply:SetArmor( 100 );
	self:Remove();

end


Go into addentities.lua:



AddCustomShipment( "Armor", "models/props_interiors/BathTub01a.mdl", "armor", 123, 1, true, 1, true, {TEAM_???} );


Change the 1 before the last true to the price, change models/ in both init.lua and addentities.lua to whatever model you want it to be. Go ingame, click Q, right click a prop > Copy to clipboard.
Change TEAM_??? to the team(s) that should sell it, more than one team: TEAM_???, TEAM_???

Where exactly would I put this? A little more information would be helpful. (when I said I don’t know much, I’m talking bare minimum sorry :S)
**
Edit:**
Answered immediately as I posted this. Woops. :stuck_out_tongue:

[editline]16th September 2013[/editline]

This is exactly what I needed. Thank you!