+void GenericCommand_dumpnotifs(float request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ #ifndef MENUQC
+ float fh, alsoprint = FALSE;
+ string filename = argv(1);
+
+ if(filename == "")
+ {
+ filename = "notifications.cfg";
+ alsoprint = FALSE;
+ }
+ else if(filename == "-")
+ {
+ filename = "notifications.cfg";
+ alsoprint = TRUE;
+ }
+ fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ Dump_Notifications(fh, alsoprint);
+ print(sprintf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename));
+ fclose(fh);
+ }
+ else
+ {
+ print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ }
+ #else
+ print(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+ #endif
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+ print(" Where 'filename' is the file to write (default is notifications.cfg),\n");
+ print(" if supplied with '-' output to console as well as default,\n");
+ print(" if left blank, it will only write to default.\n");
+ return;
+ }
+ }
+}
+