]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
New banning systems (ignore, muteban, voteban and playban) and new features for moder...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 28fa7e7c056dae29e0675fce7c1eeb467fa4d469..6af0a28e4a79deb902c1e2e90ecfdaf7bc715f6a 100644 (file)
@@ -849,6 +849,13 @@ void VoteCommand_abstain(int request, entity caller)  // CLIENT ONLY
        {
                case CMD_REQUEST_COMMAND:
                {
+                       if (PlayerInList(caller, autocvar_g_voteban_list)) // voteban
+                       {
+                               print_to(caller, "^1You are banned from voting.");
+                               Send_Notification(NOTIF_ONE, caller, MSG_CENTER, CENTER_VOTEBANYN);
+                               return;
+                       }
+
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
                        else if (caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change)
                        {
@@ -891,6 +898,13 @@ void VoteCommand_call(int request, entity caller, int argc, string vote_command)
                        float tmp_playercount = 0;
                        int parse_error;
 
+                       if (PlayerInList(caller, autocvar_g_voteban_list)) // voteban
+                       {
+                               print_to(caller, "^1You are banned from calling a vote.");
+                               Send_Notification(NOTIF_ONE, caller, MSG_CENTER, CENTER_VOTEBAN);
+                               return;
+                       }
+
                        vote_command = VoteCommand_extractcommand(vote_command, 2, argc);
 
                        if (!autocvar_sv_vote_call && caller)
@@ -1106,6 +1120,13 @@ void VoteCommand_no(int request, entity caller)  // CLIENT ONLY
        {
                case CMD_REQUEST_COMMAND:
                {
+                       if (PlayerInList(caller, autocvar_g_voteban_list)) // voteban
+                       {
+                               print_to(caller, "^1You are banned from voting.");
+                               Send_Notification(NOTIF_ONE, caller, MSG_CENTER, CENTER_VOTEBANYN);
+                               return;
+                       }
+
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
                        else if (caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change)
                        {
@@ -1188,6 +1209,13 @@ void VoteCommand_yes(int request, entity caller)  // CLIENT ONLY
        {
                case CMD_REQUEST_COMMAND:
                {
+                       if (PlayerInList(caller, autocvar_g_voteban_list)) // voteban
+                       {
+                               print_to(caller, "^1You are banned from voting.");
+                               Send_Notification(NOTIF_ONE, caller, MSG_CENTER, CENTER_VOTEBANYN);
+                               return;
+                       }
+
                        if (!vote_called) { print_to(caller, "^1No vote called."); }
                        else if (caller.vote_selection != VOTE_SELECT_NULL && !autocvar_sv_vote_change)
                        {