Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.PrintName = "M_Portable_Radio"
- SWEP.Author = "jamiemarlin"
- SWEP.Instructions = "hold on inventory and stand by transmitter to broadcast, press left click to get distance"
- SWEP.Spawnable = true
- SWEP.AdminOnly = true
- 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.Weight = 10
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 2
- SWEP.SlotPos = 2
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = false
- SWEP.ViewModel = "models/weapons/v_pistol.mdl"
- SWEP.WorldModel = "models/weapons/w_pistol.mdl"
- function SWEP:PrimaryAttack()
- self:SetNextPrimaryFire( CurTime() + 0.5 )
- FindTransmitter()
- end
- local function FindTransmitter()
- local NeRad = nil
- local Rads = Ents:FindByName("M_Transmittion_Radio")
- for i = 1, #Rads do
- if NeRad == nil or LocalPlayer():GetPos():DistToSqr( NeRad:GetPos() ) > LocalPlayer():GetPos():DistToSqr( Rads[i]:GetPos() ) then NeRad = Rads[i] end
- end
- print( LocalPlayer():GetPos():DistToSqr( NeRad:GetPos() ) )
- end
Add Comment
Please, Sign In to add comment