2 #include "../dpdefs/csprogsdefs.qh"
3 #include "../client/defs.qh"
4 #include "../csqcmodellib/cl_model.qh"
7 #include "../dpdefs/progsdefs.qh"
8 #include "../dpdefs/dpextensions.qh"
9 #include "constants.qh"
10 #include "net_notice.qh"
11 #include "../server/defs.qh"
15 void sv_notice_join_think()
18 float argc = tokenizebyseparator(autocvar_sv_join_notices, "|");
22 for(i = argc - 1; i >= 0; --i)
23 sv_notice_to(self.owner, argv(i), autocvar_sv_join_notices_time, false);
30 // to-do: make sv_join_notices support per-entry times
31 if(autocvar_sv_join_notices == "")
36 n.think = sv_notice_join_think;
37 n.nextthink = time + 1;
40 void sv_notice_to(entity _to, string _notice, float _howlong, float _modal)
43 WriteByte(MSG_ONE, SVC_TEMPENTITY);
44 WriteByte(MSG_ONE, TE_CSQC_SVNOTICE);
45 WriteString(MSG_ONE, _notice);
46 WriteLong(MSG_ONE, _howlong);
47 WriteByte(MSG_ONE, _modal);
50 void sv_notice_toall(string _notice, float _howlong, float _modal)
53 FOR_EACH_REALCLIENT(_head)
54 sv_notice_to(_head, _notice, _howlong, _modal);
70 _notice.classname = "sv_notice";
71 _notice.netname = strzone(ReadString());
72 _notice.alpha = ReadLong() + time;
73 _notice.skin = ReadByte();
82 _notes = findchain(classname, "sv_notice");
88 vector v1, v2 = '0 0 0', v3;
90 v2_x = vid_conwidth - (2 * M1);
91 v2_y = vid_conheight - (2 * M1);
93 drawfill(v1, v2, '0 0 0', 0.5, DRAWFLAG_NORMAL);
94 v1 = '1 1 0' * (M1 + M2);
95 v2_x = vid_conwidth - (2 * (M1 + M2));
96 v2_y = vid_conheight - (2 * (M1 + M2));
97 drawfill(v1, v2, '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
100 #define OUT(s,z) drawcolorcodedstring(v3, s, '1 1 0' * z, 1, DRAWFLAG_NORMAL); v3_y += z + 4
102 OUT(_("^1Server notices:"), 32);
104 //drawcolorcodedstring(v1 + '5 5 0', "^1Server notices:", '32 32 0', 1, DRAWFLAG_NORMAL);
108 _notice = sprintf(_("^7%s (^3%d sec left)"), _notes.netname , rint(_notes.alpha - time));
114 if(_notes.alpha <= time)
116 _notes.think = SUB_Remove;
117 _notes.nextthink = time;
120 _notes = _notes.chain;