• TTT Pointshop weapons
    10 replies, posted
I tried putting two weapons in my pointshop. Both of them show up fine, and it lets us equip and buy them but they do not go in our inventory so we can use them Here are the two scripts for one of my weapons: 1. if ( SERVER ) then AddCSLuaFile( "shared.lua" ) SWEP.HoldType = "revolver" end if ( CLIENT ) then SWEP.PrintName = "Dual Berettas" SWEP.Slot = 1 SWEP.SlotPos = 1 SWEP.ViewModelFOV = 75 SWEP.IconLetter = "b" SWEP.HoldType = "revolver" killicon.AddFont( "weapon_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) ) end SWEP.Base = "weapon_tttbase" SWEP.Kind = WEAPON_PISTOL SWEP.ViewModelFlip = true SWEP.Category = "Other" SWEP.Spawnable = false SWEP.AdminSpawnable = true SWEP.AutoSpawnable = false SWEP.ViewModel = "models/weapons/v_pist_elete.mdl" SWEP.WorldModel = "models/weapons/w_pist_elete.mdl" SWEP.Base = "weapon_tttbase" SWEP.Kind = WEAPON_PISTOL SWEP.AutoSpawnable = false SWEP.AmmoEnt = "item_ammo_pistol_ttt" SWEP.InLoadoutFor = nil SWEP.AllowDrop = true SWEP.IsSilent = false SWEP.NoSights = false SWEP.Weight = 3 SWEP.AutoSwitchTo = true SWEP.AutoSwitchFrom = true SWEP.Primary.Sound = Sound( "weapons/scout_fire-1.wav" ) SWEP.Primary.Recoil = 1 SWEP.Primary.Damage = 15 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.05 SWEP.Primary.ClipSize = 12 SWEP.Primary.Delay = 0.2 SWEP.Primary.DefaultClip = 12 SWEP.Primary.Automatic = false SWEP.Primary.Ammo = "pistol" SWEP.AmmoEnt = "item_ammo_pistol_ttt" SWEP.Secondary.ClipSize = -1 SWEP.Secondary.DefaultClip = -1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "none" SWEP.Offset = { Pos = { Up = 0, Right = 1, Forward = -3, }, Ang = { Up = 0, Right = 0, Forward = 0, } } function SWEP:DrawWorldModel( ) local hand, offset, rotate if not IsValid( self.Owner ) then self:DrawModel( ) return end if not self.Hand then self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" ) end hand = self.Owner:GetAttachment( self.Hand ) if not hand then self:DrawModel( ) return end offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right ) hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward ) hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up ) self:SetRenderOrigin( hand.Pos + offset ) self:SetRenderAngles( hand.Ang ) self:DrawModel( ) end 2.ITEM.Name = 'Dual Berettas' ITEM.Price = 200 ITEM.Model = 'models/weapons/w_pist_elete.mdl' ITEM.WeaponClass = 'weapon_dualberettas' ITEM.SingleUse = false function ITEM:OnBuy(ply) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(ply) ply:StripWeapon(self.WeaponClass) end
Change ITEM:OnBuy to ITEM:OnEquip
[QUOTE=code_gs;45234671]Change ITEM:OnBuy to ITEM:OnEquip[/QUOTE] Thanks for the help, but it'll still say 'Equipped Dual Berettas' but I still do not get the weapon.
Are you sure the weapon called is "weapon_duelberrettas?"
[QUOTE=code_gs;45239597]Are you sure the weapon called is "weapon_duelberrettas?"[/QUOTE] Yeah, I just checked and thats what its called.
Check to make sure there's not already a weapon in that slot
[QUOTE=NiandraLades;45242123]Check to make sure there's not already a weapon in that slot[/QUOTE] What do you mean? It shows up in pointshop, everything seems to be working fine except for the fact when we equip it we don't get the gun.
Basically, if I'm already holding a glock, and I buy a deagle from the slot, it'll take the points but not give the item If it's still not giving the item after checking this, then something else is broken
[QUOTE=BastionTTT;45244811]What do you mean? It shows up in pointshop, everything seems to be working fine except for the fact when we equip it we don't get the gun.[/QUOTE] or just use this code on every ps code [code] function ITEM:OnEquip(ply) ply:StripWeapon(self.WeaponClass) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnHolster(ply) ply:StripWeapon(self.WeaponClass) end [/code] It will auto take the weapon that is in that slot first
The code still did not work, and that is not the problem. I need to know what the problem is because we're putting the server up Tuesday and we have no pointshop stuff done for our donators.
Did you found a way to fix it ? Cause i got the same problem...
Sorry, you need to Log In to post a reply to this thread.