Skip to content

Commit

Permalink
Redefine constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Doridian committed Dec 27, 2024
1 parent aaf31b0 commit bd63ca1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lua/caf/core/server/notify.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
-- These are no longer defined on the server, so define them ourselves...
NOTIFY_GENERIC = 0
NOTIFY_ERROR = 1
NOTIFY_UNDO = 2
NOTIFY_HINT = 3
NOTIFY_CLEANUP = 4

local PLY = FindMetaTable("Player")
util.AddNetworkString("Player_AddHint")
function PLY:AddHint(txt, typ, len)
if not txt then
error("No text specified for hint")
return
end

net.Start("Player_AddHint")
net.WriteString(txt)
net.WriteInt(typ, 32)
net.WriteInt(len, 32)
net.WriteInt(typ or NOTIFY_GENERIC, 32)
net.WriteInt(len or 5, 32)
net.Send(self)
end

Expand Down

0 comments on commit bd63ca1

Please sign in to comment.