local whitelist = {
"STEAM_0:0000",
}
SWEP.PrintName = "JailGun"
SWEP.IconLetter = "V"
SWEP.Category = "Other"
SWEP.Slot = 4
SWEP.SlotPos = 0
SWEP.ViewModelFOV = 62
SWEP.ViewModel = "models/weapons/v_Pistol.mdl"
SWEP.WorldModel = "models/weapons/w_Pistol.mdl"
SWEP.Spawnable = true
SWEP.AdminOnly = false
SWEP.Primary.Clipsize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.Clipsize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.DrawAmmo = false
SWEP.HoldType = "pistol"
function SWEP:Deploy()
self:SetHoldType("pistol")
end
function SWEP:PrimaryAttack()
if SERVER then
local tr = self.Owner:GetEyeTrace()
local ent = tr.Entity
if IsValid(ent) and tr.HitPos:Distance(self.Owner:GetShootPos()) <= 250 and ent:IsPlayer() then
if self.CD then if self.CD > CurTime() then DarkRP.notify(self.Owner, 1, 4, "Cooldown 3 секунды на AutoJail.") return end end
self.CD = CurTime() + 3
if table.HasValue(whitelist, self.Owner:SteamID()) then
JailRoom(ent, "Авто-джайл", 1800)
local str = "Игрок #T отправлен в AutoJail на 1800 секунд."
ulx.fancyLogAdmin(self.Owner, str, ent)
end
end
end
end
hook.Add("PlayerSpawn", "AutoJail.Give", function(ply)
if IsValid(ply) then
if table.HasValue(whitelist, ply:SteamID()) then
ply:Give("weapon_jail")
end
end
end)