Skip to content

Commit bd63ca1

Browse files
committed
Redefine constants
1 parent aaf31b0 commit bd63ca1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lua/caf/core/server/notify.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1+
-- These are no longer defined on the server, so define them ourselves...
2+
NOTIFY_GENERIC = 0
3+
NOTIFY_ERROR = 1
4+
NOTIFY_UNDO = 2
5+
NOTIFY_HINT = 3
6+
NOTIFY_CLEANUP = 4
7+
18
local PLY = FindMetaTable("Player")
29
util.AddNetworkString("Player_AddHint")
310
function PLY:AddHint(txt, typ, len)
11+
if not txt then
12+
error("No text specified for hint")
13+
return
14+
end
15+
416
net.Start("Player_AddHint")
517
net.WriteString(txt)
6-
net.WriteInt(typ, 32)
7-
net.WriteInt(len, 32)
18+
net.WriteInt(typ or NOTIFY_GENERIC, 32)
19+
net.WriteInt(len or 5, 32)
820
net.Send(self)
921
end
1022

0 commit comments

Comments
 (0)