Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.PrintName = "E2 checker"
- SWEP.Purpose = "Giving staff on duty e2 ESP"
- SWEP.Instructions = "Equip, left click e2s"
- SWEP.Spawnable = true
- SWEP.AdminOnly = true
- SWEP.ViewModel = "models/weapons/v_hands.mdl"
- SWEP.WorldModel = ""
- 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.Slot = 1
- SWEP.SlotPos = 10
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = true
- SWEP.Cooldown = 0
- function SWEP:Initialize()
- self:SetWeaponHoldType( "normal" )
- if CLIENT then
- net.Start("AE2F")
- net.SendToServer()
- end
- end
- function SWEP:PrimaryAttack()
- if SERVER then
- local e2 = self.Owner:GetEyeTrace().Entity
- if not IsValid(e2) then return end
- local temptable = {}
- if e2:GetClass() == "gmod_wire_expression2" then
- for k,v in pairs(e2AbuseableFunctions) do
- if string.find(e2.original, v) then temptable[k] = v end
- end
- end
- net.Start("AE2FAF")
- net.WriteTable(temptable)
- net.Send(self.Owner)
- end
- end
- function SWEP:SecondaryAttack()
- end
- function SWEP:Reload()
- end
- if SERVER then
- AddCSLuaFile()
- util.AddNetworkString( "AE2F" )
- util.AddNetworkString( "AE2FAF" )
- e2AbuseableFunctions = {"egp3DTracker","runOnChat","holoCreate","fLight","lastSaid","findByClass","findByModel","findPlayerBy","propNotSolid","setPos","streamStart"}
- function getAllE2Info()
- local e2s = {}
- for k, v in pairs( ents.FindByClass( "gmod_wire_expression2" ) ) do
- if v.context then
- e2s[k] = {
- ["pos"] = v:GetPos(),
- ["name"] = v.name,
- ["ops"] = math.floor(v.context.prfbench)
- }
- end
- end
- return e2s;
- end
- net.Receive( "AE2F", function( len, ply )
- net.Start("AE2F")
- net.WriteTable(getAllE2Info())
- net.Send(ply)
- end )
- else
- surface.CreateFont( "NecFont", {
- font = "Arial",
- extended = false,
- size = 20,
- weight = 1000,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- underline = false,
- italic = false,
- strikeout = false,
- symbol = false,
- rotary = false,
- shadow = false,
- additive = false,
- outline = false,
- } )
- local e2s = {};
- net.Receive( "AE2FAF", function( len, ply )
- chat.AddText( Color( 19, 100, 100 ),"Abusable functions detected:")
- for k,v in pairs(net.ReadTable()) do
- chat.AddText( Color( 19, 232, 100 ), v)
- end
- end )
- net.Receive( "AE2F", function( len, ply )
- e2s = net.ReadTable()
- timer.Simple( 3, function()
- net.Start("AE2F")
- net.SendToServer()
- end )
- end )
- function SWEP:DrawHUD()
- for k, v in pairs( e2s ) do
- local dist = math.floor(v.pos:Distance(LocalPlayer():GetPos()))
- local Position = v.pos:ToScreen()
- local len = string.len(v.name)
- if len < string.len(v.owner) then
- len = string.len(v.owner)
- end
- local width = (len*(11-(len/10))) + 10
- surface.SetDrawColor( 0, 0, 0, 150 )
- surface.DrawRect( Position.x, Position.y, width, 75 )
- surface.SetDrawColor( 255, 0, 0, 255 )
- surface.DrawRect( Position.x, Position.y, 5, 5 )
- draw.DrawText( string.lower(v.owner), "NecFont", Position.x+10, Position.y+5, Color(255, 255, 255, 255 ), 0 )
- draw.DrawText( string.lower(v.name), "NecFont", Position.x+10, Position.y+25, Color(255, 255, 255, 255 ), 0 )
- draw.DrawText( string.lower(v.ops), "NecFont", Position.x+10, Position.y+45, Color(255, 255, 255, 255 ), 0 )
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement