return NULL;
}
-void part_minigame(entity player )
+void part_minigame(entity player)
{
entity minig = CS(player).active_minigame;
return "Invalid player";
if ( inviter == player )
return "You can't invite yourself";
+ if (PlayerInList(player, autocvar_g_playban_list) && autocvar_g_playban_minigames) // playban
+ return "You can't invite a banned player";
if ( CS(player).active_minigame == CS(inviter).active_minigame )
return strcat(player.netname," is already playing");
return;
}
+ if (PlayerInList(caller, autocvar_g_playban_list) && autocvar_g_playban_minigames) // playban
+ {
+ Send_Notification(NOTIF_ONE_ONLY, caller, MSG_CENTER, CENTER_JOIN_PLAYBAN);
+ sprint(caller, "You aren't allowed to play minigames because you are banned from them in this server.\n");
+ return;
+ }
+
if (request == CMD_REQUEST_COMMAND )
{
string minig_cmd = argv(1);
#include "banning.qh"
#include <common/command/_mod.qh>
+#include <common/minigames/sv_minigames.qh>
#include <common/state.qh>
#include <common/stats.qh>
#include <common/util.qh>
LOG_INFO(strcat("Play-banning player ", GetCallerName(client), " (", argv(1), ")."));
PutObserverInServer(client, true, true);
+ if (autocvar_g_playban_minigames)
+ part_minigame(client);
cvar_set("g_playban_list", cons(autocvar_g_playban_list, theid));
return;
bool autocvar_g_banned_list_idmode;
string autocvar_g_chatban_list;
string autocvar_g_playban_list;
+bool autocvar_g_playban_minigames;
string autocvar_g_voteban_list;
#define GET_BAN_ARG(v, d) if (argc > reason_arg) { if ((v = stof(argv(reason_arg))) != 0) ++reason_arg; else v = d; } else { v = d; }
BADCVAR("g_require_stats");
BADCVAR("g_chatban_list");
BADCVAR("g_playban_list");
+ BADCVAR("g_playban_minigames");
BADCVAR("g_voteban_list");
BADPREFIX("developer_");
BADPREFIX("g_ban_");
set g_banned_list_idmode "1" "when set, the IP banning system always uses the ID over the IP address (so a user in a banned IP range can connect if they have a valid signed ID)"
set g_chatban_list "" "list of banned players from chat; player format: IP or playerkey"
set g_playban_list "" "list of banned players from playing (forced to spectate); player format: IP or playerkey"
+set g_playban_minigames 0 "disallow playbanned players (who are forced to spectate) from playing minigames"
set g_voteban_list "" "list of banned players from voting; player format: IP or playerkey"
// useful vote aliases