]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/notifications.qc
Centralize the argument list
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / notifications.qc
1 // ================================================
2 //  Unified notification system, written by Samual
3 //  Last updated: February, 2013
4 // ================================================
5
6 #ifndef MENUQC
7 entity Get_Notif_Ent(float net_type, float net_name)
8 {
9         switch(net_type)
10         {
11                 case MSG_INFO: return msg_info_notifs[net_name - 1];
12                 case MSG_CENTER: return msg_center_notifs[net_name - 1];
13                 case MSG_WEAPON: return msg_weapon_notifs[net_name - 1];
14                 case MSG_DEATH: return msg_death_notifs[net_name - 1];
15         }
16         backtrace(sprintf("Get_Notif_Ent(%d, %d): Improper net type!\n", net_type, net_name));
17         return world;
18 }
19
20 string Get_Notif_Name(float net_type, float net_name)
21 {
22         entity e = Get_Notif_Ent(net_type, net_name);
23         if(e) { return e.nent_name; }
24         backtrace(sprintf("Get_Notif_Name(%d, %d): Could not find entity!\n", net_type, net_name));
25         return "";
26 }
27
28 float Get_Notif_Infval(float net_type, float net_name)
29 {
30         entity e = Get_Notif_Ent(net_type, net_name);
31         if(e) { return e.nent_infoname; }
32         backtrace(sprintf("Get_Notif_Infval(%d, %d): Could not find entity!\n", net_type, net_name));
33         return NO_MSG;
34 }
35
36 float Get_Notif_Cenval(float net_type, float net_name)
37 {
38         entity e = Get_Notif_Ent(net_type, net_name);
39         if(e) { return e.nent_centername; }
40         backtrace(sprintf("Get_Notif_Cenval(%d, %d): Could not find entity!\n", net_type, net_name));
41         return NO_MSG;
42 }
43
44 float Get_Notif_Strnum(float net_type, float net_name)
45 {
46         entity e = Get_Notif_Ent(net_type, net_name);
47         if(e) { return e.nent_stringcount; }
48         backtrace(sprintf("Get_Notif_Strnum(%d, %d): Could not find entity!\n", net_type, net_name));
49         return NO_MSG;
50 }
51
52 float Get_Notif_Flnum(float net_type, float net_name)
53 {
54         entity e = Get_Notif_Ent(net_type, net_name);
55         if(e) { return e.nent_floatcount; }
56         backtrace(sprintf("Get_Notif_Flnum(%d, %d): Could not find entity!\n", net_type, net_name));
57         return NO_MSG;
58 }
59 #endif // ifndef MENUQC
60
61
62 // ===============================
63 //  Frontend Notification Pushing
64 // ===============================
65
66 void Dump_Notifications(float fh, float alsoprint)
67 {
68         float MSG_INFO_NOTIFS = 0, MSG_CENTER_NOTIFS = 0, MSG_WEAPON_NOTIFS = 0, MSG_DEATH_NOTIFS = 0;
69
70         #define NOTIF_WRITE(type,name,text) { \
71                 ++##type##_NOTIFS; \
72                 notif_msg = sprintf("seta %s 1 // %s - %s\n", name, #type, strreplace("\n", "\\n", text)); \
73                 fputs(fh, notif_msg); \
74                 if(alsoprint) { print(strreplace("^", "^^", notif_msg)); } }
75
76         #ifndef MENUQC
77         string notif_msg;
78         float i;
79         entity e;
80
81         for(i = 0; i < NOTIF_INFO_COUNT; ++i) {
82                 e = Get_Notif_Ent(MSG_INFO, i);
83                 NOTIF_WRITE(MSG_INFO, e.nent_name, e.nent_string); }
84                 
85         for(i = 0; i < NOTIF_CENTER_COUNT; ++i) {
86                 e = Get_Notif_Ent(MSG_CENTER, i);
87                 NOTIF_WRITE(MSG_CENTER, e.nent_name, e.nent_string); }
88         
89         for(i = 0; i < NOTIF_WEAPON_COUNT; ++i) {
90                 e = Get_Notif_Ent(MSG_WEAPON, i);
91                 NOTIF_WRITE(MSG_WEAPON, e.nent_name, sprintf("infoname: %s, centername: %s",
92                         Get_Notif_Name(MSG_INFO, Get_Notif_Infval(MSG_WEAPON, i)),
93                         Get_Notif_Name(MSG_CENTER, Get_Notif_Cenval(MSG_WEAPON, i)) ) ); }
94                 
95         for(i = 0; i < NOTIF_DEATH_COUNT; ++i) {
96                 e = Get_Notif_Ent(MSG_DEATH, i);
97                 NOTIF_WRITE(MSG_DEATH, e.nent_name, sprintf("infoname: %s, centername: %s",
98                         Get_Notif_Name(MSG_INFO, Get_Notif_Infval(MSG_DEATH, i)),
99                         Get_Notif_Name(MSG_CENTER, Get_Notif_Cenval(MSG_DEATH, i)) ) ); }
100                 
101         #endif
102
103         print(sprintf("Notification counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n",
104                 MSG_INFO_NOTIFS, MSG_CENTER_NOTIFS, MSG_WEAPON_NOTIFS, MSG_DEATH_NOTIFS));
105         
106         return;
107         #undef NOTIF_WRITE
108 }
109
110 #ifndef MENUQC
111 string Local_Notification_sprintf(string input, string args, 
112         string s1, string s2, string s3, string s4,
113         float f1, float f2, float f3, float f4)
114 {
115         #ifdef NOTIFICATIONS_DEBUG
116         dprint(
117                 sprintf("Local_Notification_sprintf('%s'^7, '%s', %s, %s);\n",
118                 strreplace("\n", "\\n", input), args,
119                 sprintf("%s, %s, %s, %s", s1, s2, s3, s4),
120                 sprintf("%d, %d, %d, %d", f1, f2, f3, f4)));
121         #endif
122         
123         string selected, remaining = args;
124         float sel_num = 0;
125
126         #ifdef CSQC
127         string tmp_s;
128         #endif
129
130         arg_slot[0] = ""; arg_slot[1] = ""; arg_slot[2] = ""; arg_slot[3] = ""; arg_slot[4] = ""; arg_slot[5] = ""; arg_slot[6] = "";
131         
132         if((remaining != "") && (input != ""))
133         {
134                 for(;remaining;)
135                 {
136                         selected = car(remaining); remaining = cdr(remaining);
137
138                         switch(strtolower(selected))
139                         {
140                                 #define ARG_CASE(prog,selected,result) \
141                                         #ifdef CSQC \
142                                         #if (prog == ARG_BOTH) || (prog == ARG_CSQC) \
143                                                 case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
144                                         #endif \
145                                         #else \
146                                         #if (prog == ARG_BOTH) || (prog == ARG_SVQC) \
147                                                 case selected: { arg_slot[sel_num] = result; ++sel_num; break; } \
148                                         #endif \
149                                         #endif
150
151                                 NOTIF_ARGUMENT_LIST
152                                 #undef ARG_CASE
153                                 default: { backtrace(sprintf("Hit unknown token in selected string! '%s'\n", selected)); break; }
154                         }
155                         if((sel_num+1) > 7) { backtrace("Hit maximum arguments!\n"); break; }
156                 }
157
158                 return sprintf(input, arg_slot[0], arg_slot[1], arg_slot[2], arg_slot[3], arg_slot[4], arg_slot[5], arg_slot[6]);
159         }
160
161         return "";
162 }
163
164 #ifdef CSQC
165 void Local_Notification_HUD_Notify_Push(string icon, string hudargs, string s1, string s2)
166 {
167         string selected, remaining = hudargs;
168         float sel_num = 0;
169
170         arg_slot[0] = ""; arg_slot[1] = "";
171         
172         if(remaining != "")
173         {
174                 for(;remaining;)
175                 {
176                         selected = car(remaining); remaining = cdr(remaining);
177
178                         switch(strtolower(selected))
179                         {
180                                 #define ARG_CASE(selected,result) case selected: { arg_slot[sel_num] = result; ++sel_num; break; }
181                                 ARG_CASE("s1", s1)
182                                 ARG_CASE("s2", s2)
183                                 #undef ARG_CASE
184                                 default: { backtrace(sprintf("Hit unknown token in selected string! '%s'\n", selected)); break; }
185                         }
186                         if((sel_num+1) > 2) { backtrace("Hit maximum arguments!\n"); break; }
187                 }
188         }
189
190         HUD_Notify_Push(icon, arg_slot[0], arg_slot[1]);
191 }
192 #endif
193
194 void Local_Notification(float net_type, float net_name, ...count)
195 {
196         // check supplied type and name for errors
197         #ifdef NOTIFICATIONS_DEBUG
198         {
199                 #define CHECKARG_TYPENAME(type) case MSG_##type##: \
200                         { if(!net_name || (net_name > NOTIF_##type##_COUNT)) \
201                         { checkargs = sprintf("Improper name: %d!", net_name); } break; }
202                 string checkargs = "";
203                 switch(net_type)
204                 {
205                         CHECKARG_TYPENAME(INFO)
206                         CHECKARG_TYPENAME(CENTER)
207                         CHECKARG_TYPENAME(WEAPON)
208                         CHECKARG_TYPENAME(DEATH)
209                         default: { checkargs = sprintf("Improper type: %d!", checkargs, net_type); break; }
210                 }
211                 #undef CHECKARG_TYPENAME
212                 if(checkargs != "") { backtrace(sprintf("Incorrect usage of Local_Notification: %s\n", checkargs)); return; }
213         }
214         #endif
215
216         entity notif = Get_Notif_Ent(net_type, net_name);
217         if not(notif) { backtrace("Local_Notification: Could not find notification entity! (This wasn't caught by usage check?...)\n"); return; }
218         if not(notif.nent_enabled) { print("entity notification was disabled...\n"); return; }
219
220         string s1 = ((0 < notif.nent_stringcount) ? ...(0, string) : "");
221         string s2 = ((1 < notif.nent_stringcount) ? ...(1, string) : "");
222         string s3 = ((2 < notif.nent_stringcount) ? ...(2, string) : "");
223         string s4 = ((3 < notif.nent_stringcount) ? ...(3, string) : "");
224         float f1 = ((notif.nent_stringcount < count) ? ...(notif.nent_stringcount, float) : NO_FL_ARG);
225         float f2 = (((notif.nent_stringcount + 1) < count) ? ...((notif.nent_stringcount + 1), float) : NO_FL_ARG);
226         float f3 = (((notif.nent_stringcount + 2) < count) ? ...((notif.nent_stringcount + 2), float) : NO_FL_ARG);
227         float f4 = (((notif.nent_stringcount + 3) < count) ? ...((notif.nent_stringcount + 3), float) : NO_FL_ARG);
228
229         #ifdef NOTIFICATIONS_DEBUG
230         {
231                 dprint(sprintf("Local_Notification(%d, %s, %s, %s, %s, %s, %d, %d, %d, %d);\n",
232                         net_type, notif.nent_name,
233                         s1, s2, s3, s4, f1, f2, f3, f4));
234
235                 if((notif.nent_stringcount + notif.nent_floatcount) > count)
236                         { backtrace(sprintf(strcat("Not enough arguments for Send_Notification! stringcount(%d) + floatcount(%d) > count(%d)\n", 
237                         "Check the notification definition and function call for accuracy...?\n"), notif.nent_stringcount, notif.nent_floatcount, count)); return; }
238                 else if((notif.nent_stringcount + notif.nent_floatcount) < count)
239                         { backtrace(sprintf(strcat("Too many arguments for Send_Notification! stringcount(%d) + floatcount(%d) < count(%d)\n",
240                         "Check the notification definition and function call for accuracy...?\n"), notif.nent_stringcount, notif.nent_floatcount, count)); return; }
241         }
242         #endif
243         
244         switch(net_type)
245         {
246                 case MSG_INFO:
247                 {
248                         print(Local_Notification_sprintf(notif.nent_string, notif.nent_args, 
249                                 s1, s2, s3, s4, f1, f2, f3, f4));
250                         #ifdef CSQC 
251                         if(notif.nent_icon != "") { Local_Notification_HUD_Notify_Push(notif.nent_icon, notif.nent_hudargs, s1, s2); } 
252                         #endif 
253                         break;
254                 }
255                 
256                 #ifdef CSQC
257                 case MSG_CENTER:
258                 {
259                         centerprint_generic(notif.nent_cpid,
260                                 Local_Notification_sprintf(notif.nent_string, notif.nent_args, 
261                                 s1, s2, s3, s4, f1, f2, f3, f4), 0, 0);
262                         break;
263                 }
264                 #endif
265                 
266                 case MSG_WEAPON:
267                 case MSG_DEATH:
268                 {
269                         if(notif.nent_infoname)
270                         if(msg_info_notifs[notif.nent_infoname - 1].nent_enabled)
271                         {
272                                 Local_Notification_Without_VarArgs(MSG_INFO, notif.nent_infoname, 
273                                         Get_Notif_Strnum(MSG_INFO, notif.nent_infoname), 
274                                         Get_Notif_Flnum(MSG_INFO, notif.nent_infoname), 
275                                         s1, s2, s3, s4, f1, f2, f3, f4);
276                         }
277                         #ifdef CSQC
278                         if(notif.nent_centername)
279                         if(msg_center_notifs[notif.nent_centername - 1].nent_enabled)
280                         {
281                                 Local_Notification_Without_VarArgs(MSG_CENTER, notif.nent_centername, 
282                                         Get_Notif_Strnum(MSG_CENTER, notif.nent_centername), 
283                                         Get_Notif_Flnum(MSG_CENTER, notif.nent_centername), 
284                                         s1, s2, s3, s4, f1, f2, f3, f4); 
285                         }
286                         #endif
287                         break;
288                 }
289         }
290 }
291
292 void Local_Notification_Without_VarArgs(float net_type, float net_name,
293         float stringcount, float floatcount,
294         string s1, string s2, string s3, string s4,
295         float f1, float f2, float f3, float f4)
296 {
297         #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Local_Notification(net_type, net_name, args); return; }
298         EIGHT_VARS_TO_VARARGS_VARLIST
299         #undef VARITEM
300
301         Local_Notification(net_type, net_name); // some notifications don't have any arguments at all
302 }
303
304
305 // =========================
306 //  Notification Networking
307 // =========================
308
309 #ifdef CSQC
310 void Read_Notification(float is_new)
311 {
312         float net_type = ReadByte();
313         float net_name = ReadShort();
314
315         float stringcount = Get_Notif_Strnum(net_type, net_name);
316         float floatcount = Get_Notif_Flnum(net_type, net_name);
317
318         string s1 = ((stringcount >= 1) ? ReadString() : "");
319         string s2 = ((stringcount >= 2) ? ReadString() : "");
320         string s3 = ((stringcount >= 3) ? ReadString() : "");
321         string s4 = ((stringcount == 4) ? ReadString() : "");
322         float f1 = ((floatcount >= 1) ? ReadLong() : NO_FL_ARG);
323         float f2 = ((floatcount >= 2) ? ReadLong() : NO_FL_ARG);
324         float f3 = ((floatcount >= 3) ? ReadLong() : NO_FL_ARG);
325         float f4 = ((floatcount == 4) ? ReadLong() : NO_FL_ARG);
326
327         #ifdef NOTIFICATIONS_DEBUG
328         dprint(sprintf("Read_Notification(%d) at %f: net_name = %s.\n", is_new, time, Get_Notif_Name(net_type, net_name)));
329         #endif
330         
331         if(is_new) { Local_Notification_Without_VarArgs(net_type, net_name, stringcount, floatcount, s1, s2, s3, s4, f1, f2, f3, f4); }
332 }
333 #endif
334
335 #ifdef SVQC
336 void Notification_Remove()
337 {
338         float i;
339         for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
340         remove(self);
341 }
342
343 float Write_Notification(entity client, float sf)
344 {
345         float i, send = FALSE;
346         
347         switch(self.nent_broadcast)
348         {
349                 case NOTIF_ONE: { if((client == self.nent_client) || (client.classname == STR_SPECTATOR && client.enemy == self.nent_client)) { send = TRUE; } break; }
350                 case NOTIF_ONE_ONLY: { if(client == self.nent_client) { send = TRUE; } break; }
351                 case NOTIF_TEAM: { if((client.team == self.nent_client.team) || (client.classname == STR_SPECTATOR && client.enemy.team == self.nent_client.team)) { send = TRUE; } break; }
352                 case NOTIF_TEAM_EXCEPT: { if(((client != self.nent_client) && (client.team == self.nent_client.team) && !(client.classname == STR_SPECTATOR && client.enemy == self.nent_client))) { send = TRUE; } break; }
353                 case NOTIF_ANY: { send = TRUE; break; }
354                 case NOTIF_ANY_EXCEPT: { if((client != self.nent_client) && !(client.classname == STR_SPECTATOR && client.enemy == self.nent_client)) { send = TRUE; } break; }
355                 default: { send = FALSE; break; }
356         }
357
358         if(send)
359         {               
360                 WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
361                 WriteByte(MSG_ENTITY, self.nent_net_type);
362                 WriteShort(MSG_ENTITY, self.nent_net_name);
363                 for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); } 
364                 for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
365         }
366
367         return send; 
368 }
369
370 void Send_Notification(float broadcast, entity client,
371         float net_type, float net_name, ...count)
372 {
373         // check supplied broadcast, target, type, and name for errors
374         #ifdef NOTIFICATIONS_DEBUG
375         #define CHECKARG_TYPENAME(type) case MSG_##type##: \
376                 { if(!net_name || (net_name > NOTIF_##type##_COUNT)) \
377                 { checkargs = sprintf("Improper name: %d!", net_name); } break; }
378         string checkargs = "";
379         switch(net_type)
380         {
381                 CHECKARG_TYPENAME(INFO)
382                 CHECKARG_TYPENAME(CENTER)
383                 CHECKARG_TYPENAME(WEAPON)
384                 CHECKARG_TYPENAME(DEATH)
385                 default: { checkargs = sprintf("Improper type: %d!", checkargs, net_type); break; }
386         }
387         #undef CHECKARG_TYPENAME
388         if(checkargs != "") { checkargs = strcat(checkargs, " "); }
389         switch(broadcast)
390         {
391                 case NOTIF_ONE:
392                 case NOTIF_ONE_ONLY: { if(clienttype(client) == CLIENTTYPE_NOTACLIENT) { checkargs = sprintf("%sNo client provided!", checkargs); } break; }
393                 case NOTIF_ANY_EXCEPT: { if(clienttype(client) == CLIENTTYPE_NOTACLIENT) { checkargs = sprintf("%sException can't be a non-client!", checkargs); } break; }
394                 case NOTIF_ANY: { if(client) { checkargs = sprintf("%sEntity provided when world was required!", checkargs); } break; }
395                 case NOTIF_TEAM:
396                 case NOTIF_TEAM_EXCEPT:
397                 {
398                         if not(teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); }
399                         else if(clienttype(client) == CLIENTTYPE_NOTACLIENT)
400                         {
401                                 if(broadcast == NOTIF_TEAM) { checkargs = sprintf("%sNo client provided!", checkargs); }
402                                 else { checkargs = sprintf("%sException can't be a non-client!", checkargs); }
403                         }
404                         break;
405                 }
406                 default: { checkargs = sprintf("%sImproper broadcast: %d!", checkargs, broadcast); break; }
407         }
408         if(checkargs != "") { backtrace(sprintf("Incorrect usage of Send_Notification: %s\n", checkargs)); return; }
409         #endif
410
411         // retreive counts for the arguments of this notification
412         entity notif = Get_Notif_Ent(net_type, net_name);
413         if not(notif) { backtrace("Send_Notification: Could not find notification entity! (This wasn't caught by usage check?...)\n"); return; }
414         if not(notif.nent_enabled) { print("entity notification was disabled...\n"); return; }
415
416         #ifdef NOTIFICATIONS_DEBUG
417         dprint(sprintf("Send_Notification(%d, %d, %s, stringcount: %d, floatcount: %d, varargs: %d);\n",
418                 broadcast, net_type, notif.nent_name, notif.nent_stringcount, notif.nent_floatcount, count));
419
420         if((notif.nent_stringcount + notif.nent_floatcount) > count)
421                 { backtrace(sprintf(strcat("Not enough arguments for Send_Notification! stringcount(%d) + floatcount(%d) > count(%d)\n", 
422                 "Check the notification definition and function call for accuracy...?\n"), notif.nent_stringcount, notif.nent_floatcount, count)); return; }
423         else if((notif.nent_stringcount + notif.nent_floatcount) < count)
424                 { backtrace(sprintf(strcat("Too many arguments for Send_Notification! stringcount(%d) + floatcount(%d) < count(%d)\n",
425                 "Check the notification definition and function call for accuracy...?\n"), notif.nent_stringcount, notif.nent_floatcount, count)); return; }
426         #endif
427
428         notif = world; // is this needed?
429         notif = spawn();
430         notif.nent_broadcast = broadcast;
431         notif.nent_client = client;
432         notif.nent_net_type = net_type;
433         notif.nent_net_name = net_name;
434         notif.nent_stringcount = notif.nent_stringcount;
435         notif.nent_floatcount = notif.nent_floatcount;
436         
437         float i;
438         
439         for(i = 0; i < notif.nent_stringcount; ++i) { notif.nent_strings[i] = strzone(...(i, string)); }
440         for(i = 0; i < notif.nent_floatcount; ++i) { notif.nent_floats[i] = ...((notif.nent_stringcount + i), float); }
441         
442         notif.think = Notification_Remove;
443         notif.nextthink = (time + 0.5); 
444
445         Net_LinkEntity(notif, FALSE, 0, Write_Notification);
446
447         if((!server_is_local) && (broadcast == NOTIF_ANY || broadcast == NOTIF_ANY_EXCEPT) && (net_type != MSG_CENTER))
448                 { Local_Notification_Without_VarArgs(net_type, net_name, notif.nent_stringcount, notif.nent_floatcount,
449                         IFSTR(0), IFSTR(1), IFSTR(2), IFSTR(3), IFFL(0), IFFL(1), IFFL(2), IFFL(3)); }
450 }
451
452 void Send_Notification_Without_VarArgs(float broadcast, entity client,
453         float net_type, float net_name,
454         float stringcount, float floatcount,
455         string s1, string s2, string s3, string s4,
456         float f1, float f2, float f3, float f4)
457 {               
458         #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Send_Notification(broadcast, client, net_type, net_name, args); return; }
459         EIGHT_VARS_TO_VARARGS_VARLIST
460         #undef VARITEM
461
462         Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
463 }
464
465 void Send_Notification_Legacy_Wrapper(float broadcast, entity client,
466         float net_type, float net_name,
467         string s1, string s2,
468         float f1, float f2, float f3)
469 {
470         float stringcount = Get_Notif_Strnum(net_type, net_name);
471         float floatcount = Get_Notif_Flnum(net_type, net_name);
472         Send_Notification_Without_VarArgs(broadcast, client, net_type, net_name, stringcount, floatcount, s1, s2, "", "", f1, f2, f3, NO_FL_ARG);
473 }
474
475
476 // =============================
477 //  LEGACY NOTIFICATION SYSTEMS
478 // =============================
479
480 void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
481 {
482         if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
483         {
484                 msg_entity = e;
485                 WRITESPECTATABLE_MSG_ONE({
486                         WriteByte(MSG_ONE, SVC_TEMPENTITY);
487                         WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
488                         WriteByte(MSG_ONE, id);
489                         WriteString(MSG_ONE, s);
490                         if (id != 0 && s != "")
491                         {
492                                 WriteByte(MSG_ONE, duration);
493                                 WriteByte(MSG_ONE, countdown_num);
494                         }
495                 });
496         }
497 }
498 void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
499 {
500         Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
501 }
502 #endif // ifdef SVQC
503 #endif // ifndef MENUQC