void Cmd_Voteconfig_f (edict_t * ent, char *t) { if (!*t) { gi.cprintf (ent, PRINT_HIGH, "You need an argument to the vote command (name of config).\n"); return; } if (level.intermissiontime) { gi.cprintf (ent, PRINT_HIGH, "Configvote disabled during intermission\n"); return; } // BEGIN Igor[Rock] if (level.time < 40.0) { gi.cprintf (ent, PRINT_HIGH, "Configvote currently blocked - Please vote again in %d seconds\n", (int) (41.0 - level.time)); } else { // END Igor[Rock] switch (AddVoteToConfig (t, ent)) { case 0: gi.cprintf (ent, PRINT_HIGH, "You have voted on config \"%s\"\n", t); break; case 1: gi.cprintf (ent, PRINT_HIGH, "You have changed your vote to config \"%s\"\n", t); break; default: //error gi.cprintf (ent, PRINT_HIGH, "Config \"%s\" is not in the votelist!\n", t); break; } // BEGIN Igor[Rock] } //END Igor[Rock] return; }
static void Voteconfig(edict_t *ent, const char *config) { if (!use_cvote->value) { gi.cprintf(ent, PRINT_HIGH, "Config voting is disabled.\n"); return; } if (!*config) { gi.cprintf(ent, PRINT_HIGH, "You need an argument to the vote command (name of config).\n"); return; } if (level.intermission_framenum) { gi.cprintf (ent, PRINT_HIGH, "Configvote disabled during intermission\n"); return; } if (level.realFramenum < 10 * HZ) { gi.cprintf (ent, PRINT_HIGH, "Configvote currently blocked - Please vote again in %d seconds\n", (11 * HZ - level.realFramenum) / HZ ); return; } switch (AddVoteToConfig(config, ent)) { case 0: gi.cprintf(ent, PRINT_HIGH, "You have voted on config \"%s\"\n", config); break; case 1: gi.cprintf(ent, PRINT_HIGH, "You have changed your vote to config \"%s\"\n", config); break; default: //error gi.cprintf(ent, PRINT_HIGH, "Config \"%s\" is not in the votelist!\n", config); break; } }