Hey, So I decided to add in a Perk Pointshop into my darkrp server but then I moved on to permanent weapons aswell I tested one of the perm weapons I did and it seems when the player initially spawns they get the pistol and if the player dies and spawn back in they dont get the weapon back and when they player switches job it removes the pistol and you cant get it back.
[LUA]
ITEM.Name = 'Permanent HK USP'
ITEM.Price = 1500
ITEM.Model = "models/weapons/w_pist_fokkususp.mdl"
ITEM.WeaponClass = 'm9k_usp'
ITEM.SingleUse = false
function ITEM:OnEquip(ply)
ply.droppedPSWeapons = ply.droppedPSWeapons or {}
if not ply.droppedPSWeapons[self.WeaponClass] then
ply:Give( self.WeaponClass )
ply:SelectWeapon( self.WeaponClass )
ply.droppedPSWeapons[self.WeaponClass] = true
end
end
function ITEM:OnHolster(ply)
ply:StripWeapon( self.WeaponClass )
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
[/LUA]
Thanks, Goobaa
[CODE]
function ITEM:OnEquip(ply)
ply:Give( self.WeaponClass )
ply:SelectWeapon( self.WeaponClass )
end
[/CODE]
All of that other code was completely uneccessary.
Sorry, you need to Log In to post a reply to this thread.