• [Pointshop] Give Weapon WITH FULL AMMO!! ??
    4 replies, posted
[CODE]ITEM.Name = 'AUG' ITEM.Price = 300 ITEM.Material = 'vgui/ttt/icon_aug.vmt' ITEM.WeaponClass = 'weapon_ttt_aug' ITEM.SingleUse = true function ITEM:CanPlayerBuy(ply) if GetRoundState() == ROUND_PREP then return true else ply:PS_Notify('You can`t buy Weapons now!') end end function ITEM:OnBuy(ply) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(ply) if GetRoundState() == ROUND_PREP then ply:StripWeapon(self.WeaponClass) else ply:PS_Notify('You can`t buy Weapons now!') end end[/CODE] so now i want add that, the play get full Ammo... but i dont get it... ply:GiveAmmo(200,self.WeaponClass:GetPrimaryAmmoType(),true) this dont work...
Test with this [url]http://www.facepunch.com/showthread.php?t=1405189[/url]
They dont solve it o.o so how shoud that help me ? [editline]14th July 2014[/editline] ply:GiveAmmo(self.WeaponClass.Primary.ClipMax,self.WeaponClass:GetPrimaryAmmoType(),true) Doesnt work...
[code]function ITEM:OnBuy(ply) local wep = ply:Give(self.WeaponClass) ply:GiveAmmo(wep.Primary.ClipMax, wep:GetPrimaryAmmoType(), true) ply:SelectWeapon(self.WeaponClass) end [/code] Untested.
[CODE]function ITEM:CanPlayerBuy(ply) if GetRoundState() == ROUND_PREP then return true else ply:PS_Notify('You can`t buy Weapons now!') end end function ITEM:OnBuy(ply) local wep = ply:Give(self.WeaponClass) ply:GiveAmmo(wep.Primary.ClipMax, wep:GetPrimaryAmmoType(), true) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(ply) if GetRoundState() == ROUND_PREP then ply:StripWeapon(self.WeaponClass) else ply:PS_Notify('You can`t buy Weapons now!') end end[/CODE] WORKS !!!
Sorry, you need to Log In to post a reply to this thread.