#define VOTE_SELECT_NULL 0
#define VOTE_SELECT_ACCEPT 1
-// ============================
-// Misc. Supporting Functions
-// ============================
+string GetKickVoteVictim_newcommand;
+string GetKickVoteVictim_reason;
-float Votecommand_check_assignment(entity caller, float assignment)
-{
- float from_server = (!caller);
-
- if((assignment == VC_ASGNMNT_BOTH)
- || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY)
- || (from_server && assignment == VC_ASGNMNT_SERVERONLY)))
- {
- return TRUE;
- }
+string RemapVote_display;
+string RemapVote_vote;
- return FALSE;
-}
-string VoteCommand_getprefix(entity caller)
-{
- if(caller)
- return "cmd";
- else
- return "sv_cmd";
-}
+// =============================================
+// Nagger for players to know status of voting
+// =============================================
float Nagger_SendEntity(entity to, float sendflags)
{
nagger.SendFlags |= 1;
}
-void ReadyRestartForce()
-{
- local entity e;
-
- bprint("^1Server is restarting...\n");
-
- VoteReset();
-
- // clear overtime
- if (checkrules_overtimesadded > 0 && g_race_qualifying != 2) {
- //we have to decrease timelimit to its original value again!!
- float newTL;
- newTL = autocvar_timelimit;
- newTL -= checkrules_overtimesadded * autocvar_timelimit_overtime;
- cvar_set("timelimit", ftos(newTL));
- }
- checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
-
-
- readyrestart_happened = 1;
- game_starttime = time;
- if(!g_ca && !g_arena)
- game_starttime += RESTART_COUNTDOWN;
- restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
+// =======================
+// Game logic for voting
+// =======================
- inWarmupStage = 0; //once the game is restarted the game is in match stage
+void VoteStop(entity stopper)
+{
+ bprint("\{1}^2* ^3", VoteCommand_getname(stopper), "^2 stopped ^3", VoteCommand_getname(votecaller), "^2's vote\n");
+ if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid))); }
+
+ // Don't force them to wait for next vote, this way they can e.g. correct their vote.
+ if(votecaller)
+ if(stopper == votecaller)
+ votecaller.vote_next = time + autocvar_sv_vote_stop;
- //reset the .ready status of all players (also spectators)
- FOR_EACH_CLIENTSLOT(e)
- e.ready = 0;
- readycount = 0;
- Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
+ VoteReset();
+}
- if(autocvar_teamplay_lockonrestart && teamplay) {
- lockteams = 1;
- bprint("^1The teams are now locked.\n");
- }
- //initiate the restart-countdown-announcer entity
- if(autocvar_sv_ready_restart_after_countdown && !g_ca && !g_arena)
- {
- restartTimer = spawn();
- restartTimer.think = restartTimer_Think;
- restartTimer.nextthink = game_starttime;
- }
+// ============================================
+// Misc. supporting functions for votecommand
+// ============================================
- //after a restart every players number of allowed timeouts gets reset, too
- if(autocvar_sv_timeout)
+float Votecommand_check_assignment(entity caller, float assignment)
+{
+ float from_server = (!caller);
+
+ if((assignment == VC_ASGNMNT_BOTH)
+ || ((!from_server && assignment == VC_ASGNMNT_CLIENTONLY)
+ || (from_server && assignment == VC_ASGNMNT_SERVERONLY)))
{
- FOR_EACH_REALPLAYER(e)
- e.allowedTimeouts = autocvar_sv_timeout_number;
+ return TRUE;
}
- //reset map immediately if this cvar is not set
- if (!autocvar_sv_ready_restart_after_countdown)
- reset_map(TRUE);
-
- if(autocvar_sv_eventlog)
- GameLogEcho(":restart");
+ return FALSE;
}
-void ReadyRestart()
+string VoteCommand_getprefix(entity caller)
{
- // no arena, assault support yet...
- if(g_arena | g_assault | gameover | intermission_running | race_completing)
- localcmd("restart\n");
+ if(caller)
+ return "cmd";
else
- localcmd("\nsv_hook_gamerestart\n");
-
- ReadyRestartForce();
-
- // reset ALL scores, but only do that at the beginning
- //of the countdown if sv_ready_restart_after_countdown is off!
- //Otherwise scores could be manipulated during the countdown!
- if (!autocvar_sv_ready_restart_after_countdown)
- Score_ClearAll();
+ return "sv_cmd";
}
-/**
- * Counts how many players are ready. If not enough players are ready, the function
- * does nothing. If all players are ready, the timelimit will be extended and the
- * restart_countdown variable is set to allow other functions like PlayerPostThink
- * to detect that the countdown is now active. If the cvar sv_ready_restart_after_countdown
- * is not set the map will be resetted.
- *
- * Function is called after the server receives a 'ready' sign from a player.
- */
-void ReadyCount()
+string VoteCommand_getname(entity caller)
{
- entity tmp_player;
- float t_ready, t_players;
-
- FOR_EACH_REALPLAYER(tmp_player)
- {
- ++t_players;
- if(tmp_player.ready) { ++t_ready; }
- }
-
- readycount = t_ready;
-
- Nagger_ReadyCounted();
-
- // TODO: Add ability to
- if(t_ready) // at least one is ready
- if(t_ready == t_players) // and, everyone is ready
- ReadyRestart();
+ if(caller)
+ return caller.netname;
+ else
+ return ((autocvar_sv_adminnick != "") ? autocvar_sv_adminnick : autocvar_hostname);
}
-
-// Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
-void restartTimer_Think()
+string VoteCommand_extractcommand(string input, float startpos, float argc)
{
- restart_mapalreadyrestarted = 1;
- reset_map(TRUE);
- Score_ClearAll();
- remove(self);
- return;
+ string output;
+
+ if((argc - 1) < startpos)
+ output = "";
+ else
+ output = substring(input, argv_start_index(startpos), argv_end_index(-1) - argv_start_index(startpos));
+
+ print("VoteCommand_parse: '", output, "'. \n");
+ return output;
}
-float VoteCheckNasty(string cmd)
+float VoteCommand_checknasty(string vote_command)
{
- if(strstrofs(cmd, ";", 0) >= 0)
- return TRUE;
- if(strstrofs(cmd, "\n", 0) >= 0)
- return TRUE;
- if(strstrofs(cmd, "\r", 0) >= 0)
- return TRUE;
- if(strstrofs(cmd, "$", 0) >= 0)
+ if((strstrofs(vote_command, ";", 0) >= 0)
+ || (strstrofs(vote_command, "\n", 0) >= 0)
+ || (strstrofs(vote_command, "\r", 0) >= 0)
+ || (strstrofs(vote_command, "$", 0) >= 0))
return TRUE;
return FALSE;
}
-string GetKickVoteVictim_newcommand;
-string GetKickVoteVictim_reason;
-
-entity GetKickVoteVictim(string vote, string cmd, entity caller)
+entity GetKickVoteVictim(string vote, string cmd, entity caller) // todo re-write this
{
float tokens;
string ns;
return world;
}
-string RemapVote_display;
-string Remapvote_selection;
float RemapVote(string vote, string cmd, entity e)
{
float vote_argc;
{
if(!(victim = GetKickVoteVictim(vote, cmd, e)))
return FALSE;
- Remapvote_selection = GetKickVoteVictim_newcommand;
+ RemapVote_vote = GetKickVoteVictim_newcommand;
RemapVote_display = strcat("^1", vote, " (^7", victim.netname, "^1): ", GetKickVoteVictim_reason);
}
else
{
- Remapvote_selection = vote;
+ RemapVote_vote = vote;
RemapVote_display = strzone(strcat("^1", vote));
}
// Command Sub-Functions
// =======================
-void VoteCommand_abstain(float request, entity caller)
+void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY
{
switch(request)
{
case VC_REQUEST_COMMAND:
{
- if(votecalled)
+ if not(votecalled) { print_to(caller, "^1No vote called."); }
+ else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+
+ else // everything went okay, continue changing vote
{
- if(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change)
- {
- print_to(caller, "^1You abstained from your vote.");
- caller.vote_selection = VOTE_SELECT_ABSTAIN;
- msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
- }
- else { print_to(caller, "^1You have already voted."); }
- }
- else { print_to(caller, "^1No vote called."); }
+ print_to(caller, "^1You abstained from your vote.");
+ caller.vote_selection = VOTE_SELECT_ABSTAIN;
+ msg_entity = caller;
+ if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ }
return;
}
}
}
-void VoteCommand_call(float request, entity caller, float argc)
+void VoteCommand_call(float request, entity caller, float argc, string vote_command) // BOTH
{
switch(request)
{
}
}
-void VoteCommand_force(float request, float argc)
+void VoteCommand_force(float request, float argc, string vote_command) // SERVER ONLY
{
switch(request)
{
default:
case VC_REQUEST_USAGE:
{
- print("\nUsage:^3 vote \n");
+ print("\nUsage:^3 vote force result\n");
print(" No arguments required.\n");
return;
}
}
}
-void VoteCommand_master(float request, entity caller, float argc)
+void VoteCommand_master(float request, entity caller, float argc, string vote_command) // CLIENT ONLY
{
switch(request)
{
case VC_REQUEST_COMMAND:
{
+ if(autocvar_sv_vote_master)
+ {
+ switch(strtolower(argv(2)))
+ {
+ case "do":
+ {
+ vote_command = VoteCommand_extractcommand(vote_command, 3, argc);
+
+ if not(caller.vote_master) { print_to(caller, "^1You do not have vote master privelages."); }
+ else if not(VoteCommand_checknasty(vote_command)) { print_to(caller, "^1Syntax error in command, see 'vhelp' for more info."); }
+ else if not(RemapVote(vote_command, "vdo", caller)) { print_to(caller, "^1This command is not acceptable, see 'vhelp' for more info."); }
+
+ else // everything went okay, proceed with command
+ {
+ localcmd(strcat(RemapVote_vote, "\n"));
+ print_to(caller, strcat("Executing command '", RemapVote_display, "' on server."));
+ bprint("\{1}^2* ^3", VoteCommand_getname(caller), "^2 used their ^3master^2 status to do \"^2", RemapVote_display, "^2\".\n");
+ if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vdo:", ftos(caller.playerid), ":", RemapVote_display)); }
+ }
+
+ return;
+ }
+
+ case "login":
+ {
+ if not(autocvar_sv_vote_master_password != "") { print_to(caller, "^1Login to vote master is not allowed."); }
+ else if(caller.vote_master) { print_to(caller, "^1You are already logged in as vote master."); }
+ else if not(autocvar_sv_vote_master_password == argv(3)) { print_to(caller, strcat("Rejected vote master login from ", VoteCommand_getname(caller))); }
+
+ else // everything went okay, proceed with giving this player master privilages
+ {
+ caller.vote_master = TRUE;
+ print_to(caller, strcat("Accepted vote master login from ", VoteCommand_getname(caller)));
+ bprint("\{1}^2* ^3", VoteCommand_getname(caller), "^2 logged in as ^3master^2\n");
+ if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vlogin:", ftos(caller.playerid))); }
+ }
+
+ return;
+ }
+
+ default: // calling a vote for master
+ {
+ if not(autocvar_sv_vote_master_callable) { print_to(caller, "^1Vote to become vote master is not allowed."); } // todo update this description in defaultXonotic.cfg
+ else if(votecalled) { print_to(caller, "^1There is already a vote called."); }
+
+ else // everything went okay, continue with creating vote
+ {
+ votecalled = TRUE;
+ votecalledmaster = TRUE;
+ votecalledvote = strzone("XXX");
+ votecalledvote_display = strzone("^3master");
+ votefinished = time + autocvar_sv_vote_timeout;
+ votecaller = caller;
+
+ caller.vote_selection = VOTE_SELECT_ACCEPT;
+ caller.vote_next = time + autocvar_sv_vote_wait;
+
+ bprint("\{1}^2* ^3", VoteCommand_getname(votecaller), "^2 calls a vote to become ^3master^2.\n");
+ if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(votecaller.playerid), ":", votecalledvote_display)); }
+ Nagger_VoteChanged();
+ VoteCount(); // needed if you are the only one
+ }
+
+ return;
+ }
+ }
+ }
+ else { print_to(caller, "^1Master control of voting is not allowed."); }
return;
}
case VC_REQUEST_USAGE:
{
print("\nUsage:^3 vote master action [arguments]\n");
- print(" No arguments required.\n");
+ print(" TODO.\n");
return;
}
}
}
-void VoteCommand_no(float request, entity caller)
+void VoteCommand_no(float request, entity caller) // CLIENT ONLY
{
switch(request)
{
case VC_REQUEST_COMMAND:
{
- if(votecalled)
+ if not(votecalled) { print_to(caller, "^1No vote called."); }
+ else if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+
+ else // everything went okay, continue changing vote
{
- if(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change)
- {
- print_to(caller, "^1You rejected the vote.");
- caller.vote_selection = VOTE_SELECT_REJECT;
- msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
- }
- else { print_to(caller, "^1You have already voted."); }
- }
- else { print_to(caller, "^1No vote called."); }
+ print_to(caller, "^1You rejected the vote.");
+ caller.vote_selection = VOTE_SELECT_REJECT;
+ msg_entity = caller;
+ if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ }
return;
}
}
}
-void VoteCommand_status(float request, entity caller)
+void VoteCommand_status(float request, entity caller) // BOTH
{
switch(request)
{
}
}
-void VoteCommand_stop(float request, entity caller)
+void VoteCommand_stop(float request, entity caller) // BOTH
{
switch(request)
{
case VC_REQUEST_COMMAND:
{
+ if not(votecalled) { print_to(caller, "^1No vote called."); }
+ else if((caller == votecaller) || !caller || caller.vote_master) { VoteStop(caller); }
+ else { print_to(caller, "^1You are not allowed to stop that Vote."); }
return;
}
}
}
-void VoteCommand_yes(float request, entity caller)
+void VoteCommand_yes(float request, entity caller) // CLIENT ONLY
{
switch(request)
{
case VC_REQUEST_COMMAND:
{
- if(votecalled)
+ if not(votecalled) { print_to(caller, "^1No vote called."); }
+ if not(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change) { print_to(caller, "^1You have already voted."); }
+
+ else // everything went okay, continue changing vote
{
- if(caller.vote_selection == VOTE_SELECT_NULL || autocvar_sv_vote_change)
- {
- print_to(caller, "^1You accepted the vote.");
- caller.vote_selection = VOTE_SELECT_ACCEPT;
- msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
- }
- else { print_to(caller, "^1You have already voted."); }
- }
- else { print_to(caller, "^1No vote called."); }
+ print_to(caller, "^1You accepted the vote.");
+ caller.vote_selection = VOTE_SELECT_ACCEPT;
+ msg_entity = caller;
+ if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ }
return;
}
// ================================
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-#define VOTE_COMMANDS(request,caller,arguments) \
+#define VOTE_COMMANDS(request,caller,arguments,command) \
VOTE_COMMAND("abstain", VoteCommand_abstain(request, caller), "Abstain your vote in current vote", VC_ASGNMNT_CLIENTONLY) \
- VOTE_COMMAND("call", VoteCommand_call(request, caller, arguments), "Create a new vote for players to decide on", VC_ASGNMNT_BOTH) \
- VOTE_COMMAND("force", VoteCommand_force(request, arguments), "Force the result of a vote", VC_ASGNMNT_SERVERONLY) \
+ VOTE_COMMAND("call", VoteCommand_call(request, caller, arguments, command), "Create a new vote for players to decide on", VC_ASGNMNT_BOTH) \
+ VOTE_COMMAND("force", VoteCommand_force(request, arguments, command), "Force the result of a vote", VC_ASGNMNT_SERVERONLY) \
VOTE_COMMAND("help", VoteCommand_macro_help(caller, arguments), "Shows this information", VC_ASGNMNT_BOTH) \
- VOTE_COMMAND("master", VoteCommand_master(request, caller, arguments), "", VC_ASGNMNT_CLIENTONLY) \
+ VOTE_COMMAND("master", VoteCommand_master(request, caller, arguments, command), "", VC_ASGNMNT_CLIENTONLY) \
VOTE_COMMAND("no", VoteCommand_no(request, caller), "Select no in current vote", VC_ASGNMNT_CLIENTONLY) \
VOTE_COMMAND("status", VoteCommand_status(request, caller), "Prints information about current vote", VC_ASGNMNT_BOTH) \
VOTE_COMMAND("stop", VoteCommand_stop(request, caller), "Immediately end a vote", VC_ASGNMNT_BOTH) \
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { print(" ^2", name, "^7: ", description, "\n"); } }
- VOTE_COMMANDS(0, caller, 0)
+ VOTE_COMMANDS(0, caller, 0, "")
#undef VOTE_COMMAND
print("For help about specific commands, type ", command_origin, " vote help COMMAND\n");
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(2))) { function; return; } } }
- VOTE_COMMANDS(VC_REQUEST_USAGE, caller, argc)
+ VOTE_COMMANDS(VC_REQUEST_USAGE, caller, argc, "")
#undef VOTE_COMMAND
}
return;
}
-float VoteCommand_macro_command(entity caller, float argc)
+float VoteCommand_macro_command(entity caller, float argc, string vote_command)
{
#define VOTE_COMMAND(name,function,description,assignment) \
{ if(Votecommand_check_assignment(caller, assignment)) { if(name == strtolower(argv(1))) { function; return TRUE; } } }
- VOTE_COMMANDS(VC_REQUEST_COMMAND, caller, argc)
+ VOTE_COMMANDS(VC_REQUEST_COMMAND, caller, argc, vote_command)
#undef VOTE_COMMAND
return FALSE;
// Main function handling vote commands
// ======================================
-void VoteCommand(float request, entity caller, float argc)
+void VoteCommand(float request, entity caller, float argc, string vote_command)
{
+ // Guide for working with argc arguments by example:
+ // argc: 1 - 2 - 3 - 4
+ // argv: 0 - 1 - 2 - 3
+ // cmd vote - master - login - password
+
switch(request)
{
case VC_REQUEST_COMMAND:
{
- if(VoteCommand_macro_command(caller, argc))
+ if(VoteCommand_macro_command(caller, argc, vote_command))
return;
}
}
}
+// =======================
+// Game logic for voting
+// =======================
+
+void ReadyRestartForce()
+{
+ local entity e;
+
+ bprint("^1Server is restarting...\n");
+
+ VoteReset();
+
+ // clear overtime
+ if (checkrules_overtimesadded > 0 && g_race_qualifying != 2) {
+ //we have to decrease timelimit to its original value again!!
+ float newTL;
+ newTL = autocvar_timelimit;
+ newTL -= checkrules_overtimesadded * autocvar_timelimit_overtime;
+ cvar_set("timelimit", ftos(newTL));
+ }
+
+ checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
+
+
+ readyrestart_happened = 1;
+ game_starttime = time;
+ if(!g_ca && !g_arena)
+ game_starttime += RESTART_COUNTDOWN;
+ restart_mapalreadyrestarted = 0; //reset this var, needed when cvar sv_ready_restart_repeatable is in use
+
+ inWarmupStage = 0; //once the game is restarted the game is in match stage
+
+ //reset the .ready status of all players (also spectators)
+ FOR_EACH_CLIENTSLOT(e)
+ e.ready = 0;
+ readycount = 0;
+ Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
+
+ if(autocvar_teamplay_lockonrestart && teamplay) {
+ lockteams = 1;
+ bprint("^1The teams are now locked.\n");
+ }
+
+ //initiate the restart-countdown-announcer entity
+ if(autocvar_sv_ready_restart_after_countdown && !g_ca && !g_arena)
+ {
+ restartTimer = spawn();
+ restartTimer.think = restartTimer_Think;
+ restartTimer.nextthink = game_starttime;
+ }
+
+ //after a restart every players number of allowed timeouts gets reset, too
+ if(autocvar_sv_timeout)
+ {
+ FOR_EACH_REALPLAYER(e)
+ e.allowedTimeouts = autocvar_sv_timeout_number;
+ }
+
+ //reset map immediately if this cvar is not set
+ if (!autocvar_sv_ready_restart_after_countdown)
+ reset_map(TRUE);
+
+ if(autocvar_sv_eventlog)
+ GameLogEcho(":restart");
+}
+
+void ReadyRestart()
+{
+ // no arena, assault support yet...
+ if(g_arena | g_assault | gameover | intermission_running | race_completing)
+ localcmd("restart\n");
+ else
+ localcmd("\nsv_hook_gamerestart\n");
+
+ ReadyRestartForce();
+
+ // reset ALL scores, but only do that at the beginning
+ //of the countdown if sv_ready_restart_after_countdown is off!
+ //Otherwise scores could be manipulated during the countdown!
+ if (!autocvar_sv_ready_restart_after_countdown)
+ Score_ClearAll();
+}
+
+/**
+ * Counts how many players are ready. If not enough players are ready, the function
+ * does nothing. If all players are ready, the timelimit will be extended and the
+ * restart_countdown variable is set to allow other functions like PlayerPostThink
+ * to detect that the countdown is now active. If the cvar sv_ready_restart_after_countdown
+ * is not set the map will be resetted.
+ *
+ * Function is called after the server receives a 'ready' sign from a player.
+ */
+void ReadyCount()
+{
+ entity tmp_player;
+ float t_ready, t_players;
+
+ FOR_EACH_REALPLAYER(tmp_player)
+ {
+ ++t_players;
+ if(tmp_player.ready) { ++t_ready; }
+ }
+
+ readycount = t_ready;
+
+ Nagger_ReadyCounted();
+
+ // TODO: Add ability to
+ if(t_ready) // at least one is ready
+ if(t_ready == t_players) // and, everyone is ready
+ ReadyRestart();
+}
+
+
+// Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
+void restartTimer_Think()
+{
+ restart_mapalreadyrestarted = 1;
+ reset_map(TRUE);
+ Score_ClearAll();
+ remove(self);
+ return;
+}
+
void VoteHelp(entity e) {
string vmasterdis;
if(!autocvar_sv_vote_master) {
print_to(e, strcat("^3", autocvar_sv_vote_commands, "^7 and maybe further ^3arguments^7"));
}
-string VoteNetname(entity e)
-{
- if(e) {
- return e.netname;
- } else {
- if(autocvar_sv_adminnick != "") {
- return autocvar_sv_adminnick;
- } else {
- return autocvar_hostname;
- }
- }
-}
-
string ValidateMap(string m, entity e)
{
m = MapInfo_FixName(m);
}
}
-string VoteParse(string all, float argc) {
- if(argc < 3)
- return "";
- return substring(all, argv_start_index(2), argv_end_index(-1) - argv_start_index(2));
-}
-
float VoteCommandInList(string votecommand, string list)
{
string l;
}
void VoteAccept() {
- bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2's vote for ^1", votecalledvote_display, "^2 was accepted\n");
+ bprint("\{1}^2* ^3", VoteCommand_getname(votecaller), "^2's vote for ^1", votecalledvote_display, "^2 was accepted\n");
if(votecalledmaster)
{
if(votecaller) {
}
void VoteReject() {
- bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2's vote for ", votecalledvote_display, "^2 was rejected\n");
+ bprint("\{1}^2* ^3", VoteCommand_getname(votecaller), "^2's vote for ", votecalledvote_display, "^2 was rejected\n");
VoteReset();
Announce("votefail");
}
void VoteTimeout() {
- bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2's vote for ", votecalledvote_display, "^2 timed out\n");
+ bprint("\{1}^2* ^3", VoteCommand_getname(votecaller), "^2's vote for ", votecalledvote_display, "^2 timed out\n");
VoteReset();
Announce("votefail");
}
-void VoteStop(entity stopper) {
- bprint("\{1}^2* ^3", VoteNetname(stopper), "^2 stopped ^3", VoteNetname(votecaller), "^2's vote\n");
- if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":vote:vstop:", ftos(stopper.playerid)));
- if(stopper == votecaller) {
- // no wait for next vote so you can correct your vote
- if(votecaller) {
- votecaller.vote_next = time + autocvar_sv_vote_stop;
- }
- }
- VoteReset();
-}
-
void VoteSpam(float notvoters, float mincount, string result)
{
string s;