mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
45
gamemodes/darkrp/plugins/waypoints/sv_hooks.lua
Normal file
45
gamemodes/darkrp/plugins/waypoints/sv_hooks.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function PLUGIN:PlayerLoadedCharacter(client, character, currentChar)
|
||||
net.Start("SetupWaypoints")
|
||||
net.WriteBool(true)
|
||||
net.WriteTable(self.waypoints)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
timer.Create("ixWaypointUpdate", 60, 0, function()
|
||||
local curTime = CurTime()
|
||||
local toRemove = {}
|
||||
|
||||
for k, waypoint in pairs(PLUGIN.waypoints) do
|
||||
if (waypoint.time < curTime) then
|
||||
table.insert(toRemove, k)
|
||||
end
|
||||
end
|
||||
|
||||
if (#toRemove > 0) then
|
||||
table.sort(toRemove)
|
||||
|
||||
for i = #toRemove, 1, -1 do
|
||||
table.remove(PLUGIN.waypoints, toRemove[i])
|
||||
end
|
||||
|
||||
ix.combineNotify:AddNotification("NTC:// Updating Visual Uplink index", Color(0, 200, 150, 255))
|
||||
|
||||
net.Start("SetupWaypoints")
|
||||
net.WriteBool(true)
|
||||
net.WriteTable(PLUGIN.waypoints)
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user