ITEM.Name = 'Buy Once: Detective'
ITEM.Price = 1000
ITEM.Material = 'VGUI/ttt/sprite_traitor.vmt'
ITEM.OneUse = true
ITEM.AllowedUserGroups = { "admin", "donator", "superadmin","vipmoderator","vetadmin","sdonator","bdonator","gdonator","ddonator" }
function ITEM:OnEquip(ply, modifications)
hook.Add("TTTBeginRound", ply:UniqueID() .. "_detective", function()
if ply:GetRoleString() != "detective" then
ply:SetRole(ROLE_DETECTIVE)
ply:AddCredits(GetConVarNumber("ttt_credits_starting"))
end
if SERVER then
ply:PS_TakeItem(self.ID)
end
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective")
end)
end
function ITEM:OnHolster(ply)
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective")
end
function ITEM:OnSell(ply)
hook.Remove("TTTBeginRound", ply:UniqueID() .. "_detective")
end