1 #include "net_notice.qh"
4 void sv_notice_join_think()
7 float argc = tokenizebyseparator(autocvar_sv_join_notices, "|");
11 for(i = argc - 1; i >= 0; --i)
12 sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, false);
19 // to-do: make sv_join_notices support per-entry times
20 if(autocvar_sv_join_notices == "")
25 n.think = sv_notice_join_think;
26 n.nextthink = time + 1;
29 void sv_notice_to(entity _to, string _notice, float _howlong, float _modal)
32 WriteByte(MSG_ONE, SVC_TEMPENTITY);
33 WriteByte(MSG_ONE, TE_CSQC_SVNOTICE);
34 WriteString(MSG_ONE, _notice);
35 WriteLong(MSG_ONE, _howlong);
36 WriteByte(MSG_ONE, _modal);
39 void sv_notice_toall(string _notice, float _howlong, float _modal)
42 FOR_EACH_REALCLIENT(_head)
43 sv_notice_to(_head, _notice, _howlong, _modal);
59 _notice.classname = "sv_notice";
60 _notice.netname = strzone(ReadString());
61 _notice.alpha = ReadLong() + time;
62 _notice.skin = ReadByte();
71 _notes = findchain(classname, "sv_notice");
77 vector v1, v2 = '0 0 0', v3;
79 v2_x = vid_conwidth - (2 * M1);
80 v2_y = vid_conheight - (2 * M1);
82 drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL);
83 v1 = '1 1 0' * (M1 + M2);
84 v2_x = vid_conwidth - (2 * (M1 + M2));
85 v2_y = vid_conheight - (2 * (M1 + M2));
86 drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
89 #define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4
91 OUT(_("^1Server notices:"), 32);
93 //drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL);
97 _notice = sprintf(_("^7%s (^3%d sec left)"), _notes.netname , rint(_notes.alpha - time));
103 if(_notes.alpha <= time)
105 _notes.think = SUB_Remove;
106 _notes.nextthink = time;
109 _notes = _notes.chain;