pointshop holster

Hey, I’m trying to disable holstering permament guns during the round, how would I do that, I cant seem to be able to.

ITEM.Name = ‘Golden AK47’
ITEM.Price = 20
ITEM.Model = ‘models/weapons/v_ak49_gun.mdl’
ITEM.WeaponClass = ‘golden_ak49’
ITEM.SingleUse = false

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

basically players can equip and unequip it a million times during a round and I want it to be done only when theyre dead.



function ITEM:OnHolster(ply)
   if not roundisinprogress then -- you must change it, u know
      ply:StripWeapon(self.WeaponClass)
   end
end


Is it what u want? :v:

No, I want to disable holstering and re-equiping weapons until after they’re dead, so it has to be disabled during the round period.

Check if ply:IsSpec() inside



function ITEM:CanPlayerEquip(ply)
    return ply:Alive() -- only if alive
end


and



function ITEM:CanPlayerHolster(ply)
    return ply:Alive() -- only if alive
end


http://pointshop.burt0n.net/items/functions

It wont allow me to holster ever if I use IsSpec

Show me your code

Sorry to say, but there is alot of problems!
Firstly put you’r work in


 brackets. So it works easier :


ITEM.Name = ‘Golden AK47’
ITEM.Price = 200000
ITEM.Model = ‘models/weapons/v_vulakclt.mdl’
ITEM.WeaponClass = ‘clt_akvlcn’
ITEM.SingleUse = false

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
if not roundisinprogress then – you must change it, u know
ply:StripWeapon(self.WeaponClass)
end
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:CanPlayerEquip(ply)
return ply:IsSpec() – only if alive
end

function ITEM:CanPlayerHolster(ply)
return ply:IsSpec() – only if alive
end




**Now here's the first problem:
You don't read:**


function ITEM:OnHolster(ply)
if not roundisinprogress then – you must change it, u know
ply:StripWeapon(self.WeaponClass)
end
end]



**Read: YOU MUST change it no use... And there is no use of ITEM.SingleUse if you dont need it.
Roundisinprogress is a null line of code.
And, IsAlive aint a string either. It's ply:Alive() and IsSpec() aint a string aswell!
**And the fixed code is: if not ply:Alive() no IsSpec() or IsAlive() normal lua ~**
THIS IS THE FIXED CODE :**



ITEM.Name = ‘Golden AK47’
ITEM.Price = 200000
ITEM.Model = ‘models/weapons/v_vulakclt.mdl’
ITEM.WeaponClass = ‘clt_akvlcn’

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:CanPlayerHolster(ply)
return if not ply:Alive() – only if NOT alive
end

function ITEM:CanPlayerEquip(ply)
return if not ply:Alive() – only if NOT alive
end

function ITEM:CanPlayerBuy(ply)
return if not ply:Alive() – only if NOT alive
end




This will work, most likley. And I don't know what gamemode you'r using. So if you don't get you'r weapon every round. Then its not my fault. ( Try using a Permanent loop ) I can do that. But I think I fixed enough today :godzing: 

If this worked, give me a Friendly * Winner ~
~ Jacob