+ LOG_HELP("See also: ^2mute, g_muteban_list^7");
+ return;
+ }
+ }
+}
+
+void BanCommand_unplayban(int request, int argc)
+{
+ switch (request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if (argv(1))
+ {
+ entity client = GetIndexedEntity(argc, 1);
+ float accepted = VerifyClientEntity(client, true, false);
+ string original_arg = argv(1);
+
+ if (accepted > 0)
+ {
+ string tmp_string = "";
+ FOREACH_WORD(autocvar_g_playban_list, it != client.netaddress,
+ {
+ if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
+ continue;
+ tmp_string = cons(tmp_string, it);
+ });
+
+ cvar_set("g_playban_list", tmp_string);
+ LOG_INFO(strcat("Releasing forced to spectate player ", GetCallerName(client), " (", original_arg, ")."));
+
+ return;
+ }
+ else
+ {
+ LOG_INFO("unplayban: ", GetClientErrorString(accepted, argv(1)), ".");
+ }
+ }
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_HELP("Usage:^3 sv_cmd unplayban <banid>");
+ LOG_HELP(" Where <banid> is the ID of the forced to spectate ban of which to remove.");
+ LOG_HELP("See also: ^2playban, g_playban_list^7");
+ return;
+ }
+ }
+}
+
+void BanCommand_unvoteban(int request, int argc)
+{
+ switch (request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if (argv(1))
+ {
+ entity client = GetIndexedEntity(argc, 1);
+ float accepted = VerifyClientEntity(client, true, false);
+ string original_arg = argv(1);
+
+ if (accepted > 0)
+ {
+ string tmp_string = "";
+ FOREACH_WORD(autocvar_g_voteban_list, it != client.netaddress,
+ {
+ if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
+ continue;
+ tmp_string = cons(tmp_string, it);
+ });
+
+ cvar_set("g_voteban_list", tmp_string);
+ LOG_INFO(strcat("Unvote-banning player ", GetCallerName(client), " (", original_arg, ")."));
+
+ return;
+ }
+ else
+ {
+ LOG_INFO("unvoteban: ", GetClientErrorString(accepted, argv(1)), ".");
+ }
+ }
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_HELP("Usage:^3 sv_cmd unvoteban <banid>");
+ LOG_HELP(" Where <banid> is the ID of the ban from voting of which to remove.");
+ LOG_HELP("See also: ^2voteban, g_voteban_list^7");
+ return;
+ }
+ }
+}
+
+void BanCommand_voteban(int request, int argc, string command)
+{
+ switch (request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if (argc >= 2)
+ {
+ entity client = GetIndexedEntity(argc, 1);
+ float accepted = VerifyClientEntity(client, true, false);
+
+ if (accepted > 0)
+ {
+ string theid = "";
+ if(!PlayerInIPList(client, autocvar_g_voteban_list))
+ theid = cons(theid, client.netaddress);
+ if(!PlayerInIDList(client, autocvar_g_voteban_list))
+ theid = cons(theid, client.crypto_idfp);
+
+ LOG_INFO(strcat("Vote-banning player ", GetCallerName(client), " (", argv(1), ")."));
+ cvar_set("g_voteban_list", cons(autocvar_g_voteban_list, theid));
+
+ return;
+ }
+ else
+ {
+ LOG_INFO("voteban: ", GetClientErrorString(accepted, argv(1)), ".");
+ }
+ }
+ }
+
+ default:
+ LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_HELP("Usage:^3 sv_cmd voteban <client>");
+ LOG_HELP(" <client> is the entity number or name of the player to ban from voting,");
+ LOG_HELP("See also: ^2g_voteban_list, unvoteban^7");