So in Deathrun I have these CSGO knives which you can buy on pointshop but for some reason when your on the death team you don’t spawn in with it. Even if you attempt to re-equip it nothing happens.
Here’s one of the knifes code:
[lua]
ITEM.Name = ‘★ Bowie Knife’
ITEM.Price = 23000
ITEM.Model = ‘models/weapons/w_csgo_bowie.mdl’
ITEM.WeaponClass = ‘csgo_bowie’
function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnHolster(ply, modifications)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
[/lua]
Line 245 in init.lua has the PlayerCanPickupWeapon function defined like so: [lua]function GM:PlayerCanPickupWeapon( ply, wep )
if not ply:Alive() then return false end
local Active = ply:GetActiveWeapon()
if IsValid(Active) then
Active = Active:GetClass()
if Active == "weapon_physgun" then return false end
if Active == "weapon_placer" then return false end
end
if ply:HasWeapon( wep:GetClass() ) then return false end
if ply:Team() == TEAM_DEATH then
if wep:GetClass() != "weapon_crowbar" and pickup:GetInt() == 0 then
return false
end
end
local pickup = wep.JCanPickup
if pickup and pickup.player and pickup.player == ply then
if pickup.time and pickup.time >= CurTime() then
return false
else
wep.JCanPickup = nil
end
elseif pickup then
wep.JCanPickup = nil
end
if wep.Primary and wep.Primary.Ammo and wep.Primary.Ammo != "none" then
ply:GiveAmmo( 1000000, wep.Primary.Ammo, true )
end
return true
end[/lua]
This part is what’s getting in the way (lines 259-263): [lua]if ply:Team() == TEAM_DEATH then
if wep:GetClass() != “weapon_crowbar” and pickup:GetInt() == 0 then
return false
end
end[/lua]
Basically it only allows the deaths to have a crowbar (Unless you change the ConVar that allows deaths to pick up weapons)
Did not expect that to be a Convar, thanks!
Solution:
Added Convar: dr_allow_death_pickup 1