--by pavetr.top/ds ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ surface.CreateFont("Arial 12", { font = "Arial", size = 12, weight = 1000, outline = false, extended = true }) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ WHITE = Color(247, 249, 252, 255) RED = Color(255, 87, 51, 255) BLUE = Color(93, 173, 226, 255) GREEN = Color(34, 153, 84, 255) YELLOW = Color(241, 196, 15, 255) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ local ALARMS = {} local CREATE_MOD = false local RENDER = true local NAME = "POINT" local RADIUS = 50 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ local function CreateNotification(Text) notification.AddLegacy(Text, NOTIFY_GENERIC, 2) surface.PlaySound("common/warning.wav") end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ concommand.Add("SetRadius", function(Player, CMD, Args) if (!Args) then return end RADIUS = tonumber(Args[1]) end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ concommand.Add("SetName", function(Player, CMD, Args) if (!Args) then return end NAME = Args[1] end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ concommand.Add("SetRender", function(Player, CMD, Args) if (!Args) then return end RENDER = tobool(Args[1]) end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ concommand.Add("RemovePoint", function(Player, CMD, Args) if (!Args) then return end Name = Args[1] for Index, Point in pairs(ALARMS) do if (Point.Name == Name) then table.remove(ALARMS, Index) CreateNotification("Dot '" .. Name .. "' deleted.") end end end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ local function CreateNewPoint() hook.Add("PostDrawOpaqueRenderables", "CreateAlarmPoint", function() local Player = LocalPlayer() local Trace = Player:GetEyeTrace() if Trace.Hit then local Position = Trace.HitPos local Angle = Angle(0, Player:EyeAngles().y - 90, 0) cam.Start3D2D(Position, Angle, 1) local Height = 0 surface.DrawCircle(0, 0, RADIUS, WHITE) draw.SimpleText("Radios: " .. tostring(RADIUS), "Arial 12", 0, Height, WHITE, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) Height = Height + 15 cam.End3D2D() if (input.IsMouseDown(MOUSE_LEFT)) then CREATE_MOD = false table.insert(ALARMS, { Position = Position, Angle = Angle, Radius = RADIUS, Name = NAME, Sleep = false }) hook.Remove("PostDrawOpaqueRenderables", "CreateAlarmPoint") CreateNotification("New point created.") end end end) end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ hook.Add("PostDrawOpaqueRenderables", "AlarmSystemRender", function() for Id, Point in pairs(ALARMS) do cam.Start3D2D(Point.Position, Point.Angle, 1) local Height = 0 local Count = 0 local ValidDistance = LocalPlayer():GetPos():Distance(Point.Position) <= 500 for _, Player in pairs(player.GetAll()) do local Distance = Point.Position:Distance(Player:GetPos()) if (Distance > RADIUS) then continue end if (!Point.Sleep) then CreateNotification("On dot '" .. Point.Name .. "' joined '" .. team.GetName(Player:Team()) .. " | " .. Player:Nick() .. "'.") end Count = Count + 1 end if (RENDER && ValidDistance) then draw.SimpleText("Radius: " .. tostring(Point.Radius), "Arial 12", 0, Height, WHITE, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) Height = Height + 15 draw.SimpleText("Name: " .. tostring(Point.Name), "Arial 12", 0, Height, WHITE, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) Height = Height + 15 end if (Count > 0) then if (RENDER && ValidDistance) then surface.DrawCircle(0, 0, Point.Radius, BLUE) end if (!Point.Sleep) then Point.Sleep = true timer.Simple(2, function() Point.Sleep = false end) end else if (RENDER && ValidDistance) then surface.DrawCircle(0, 0, Point.Radius, WHITE) end end cam.End3D2D() end end) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ hook.Add("PlayerButtonDown", "AlarmSystem", function(Player, Button) if not IsFirstTimePredicted() then return end if (Button == KEY_N) then if (CREATE_MOD) then CREATE_MOD = false hook.Remove("PostDrawOpaqueRenderables", "CreateAlarmPoint") CreateNotification("Point creation mode is disabled.") else CREATE_MOD = true CreateNewPoint() CreateNotification("Point creation mode started.") end end end)