28 float reason_arg, bantime;
45 LOG_HELP(
"Usage:^3 sv_cmd ban <address> [<bantime>] [<reason>]");
46 LOG_HELP(
" <address> is the IP address or range of the player to ban,");
47 LOG_HELP(
" <bantime> is the amount of time that the ban is active (default if not provided),");
48 LOG_HELP(
" and <reason> is the string to label the ban with as reason for banning.");
49 LOG_HELP(
"See also: ^2banlist, kickban, unban^7");
70 LOG_HELP(
"See also: ^2ban, kickban, unban^7");
86 float reason_arg, bantime, masksize;
112 LOG_HELP(
"Usage:^3 sv_cmd kickban <client> [<bantime>] [<masksize>] [<reason>]");
113 LOG_HELP(
" <client> is the entity number or name of the player to ban,");
114 LOG_HELP(
" <bantime> is the amount of time that the ban is active (default if not provided),");
115 LOG_HELP(
" <masksize> is the range of the IP address (1-thru-4, default if not provided),");
116 LOG_HELP(
" and <reason> is the string to label the ban with as reason for banning.");
117 LOG_HELP(
"See also: ^2ban, banlist, unban^7");
138 theid =
cons(theid, client.netaddress);
140 theid =
cons(theid, client.crypto_idfp);
141 CS(client).muted =
true;
158 LOG_HELP(
"Usage:^3 sv_cmd mute <client>");
159 LOG_HELP(
" <client> is the entity number or name of the player to mute.");
160 LOG_HELP(
"See also: ^2unmute, g_chatban_list^7");
181 theid =
cons(theid, client.netaddress);
183 theid =
cons(theid, client.crypto_idfp);
204 LOG_HELP(
"Usage:^3 sv_cmd playban <client>");
205 LOG_HELP(
" <client> is the entity number or name of the player to ban being forced to spectate permanently,");
206 LOG_HELP(
"See also: ^2g_playban_list, unplayban^7");
220 float tmp_number = -1;
227 if (tmp_string !=
"")
228 tmp_number =
stof(tmp_string);
231 else tmp_number = -1;
237 if ((tmp_number == 0) && (
argv(1) !=
"0")) tmp_number = -1; }
250 LOG_HELP(
"Usage:^3 sv_cmd unban <banid>");
251 LOG_HELP(
" Where <banid> is the ID of the ban of which to remove.");
252 LOG_HELP(
"See also: ^2ban, banlist, kickban^7");
268 string original_arg =
argv(1);
272 string tmp_string =
"";
275 if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
277 tmp_string = cons(tmp_string, it);
280 cvar_set(
"g_chatban_list", tmp_string);
282 CS(client).muted =
false;
297 LOG_HELP(
"Usage:^3 sv_cmd unmute <client>");
298 LOG_HELP(
" <client> is the entity number or name of the player to unmute.");
299 LOG_HELP(
"See also: ^2mute, g_chatban_list^7");
315 string original_arg =
argv(1);
319 string tmp_string =
"";
322 if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
324 tmp_string = cons(tmp_string, it);
327 cvar_set(
"g_playban_list", tmp_string);
342 LOG_HELP(
"Usage:^3 sv_cmd unplayban <banid>");
343 LOG_HELP(
" Where <banid> is the ID of the forced to spectate ban of which to remove.");
344 LOG_HELP(
"See also: ^2playban, g_playban_list^7");
360 string original_arg =
argv(1);
364 string tmp_string =
"";
367 if(client.crypto_idfp && it == substring(client.crypto_idfp, 0, strlen(it)))
369 tmp_string = cons(tmp_string, it);
372 cvar_set(
"g_voteban_list", tmp_string);
387 LOG_HELP(
"Usage:^3 sv_cmd unvoteban <banid>");
388 LOG_HELP(
" Where <banid> is the ID of the ban from voting of which to remove.");
389 LOG_HELP(
"See also: ^2voteban, g_voteban_list^7");
410 theid =
cons(theid, client.netaddress);
412 theid =
cons(theid, client.crypto_idfp);
430 LOG_HELP(
"Usage:^3 sv_cmd voteban <client>");
431 LOG_HELP(
" <client> is the entity number or name of the player to ban from voting,");
432 LOG_HELP(
"See also: ^2g_voteban_list, unvoteban^7");
467#define BAN_COMMANDS(request, arguments, command) \
468 BAN_COMMAND("ban", BanCommand_ban(request, arguments, command), "Ban an IP address or a range of addresses (like 1.2.3)") \
469 BAN_COMMAND("banlist", BanCommand_banlist(request), "List all existing bans") \
470 BAN_COMMAND("kickban", BanCommand_kickban(request, arguments, command), "Disconnect a client and ban it at the same time") \
471 BAN_COMMAND("mute", BanCommand_mute(request, arguments, command), "Disallow a client from talking by muting them") \
472 BAN_COMMAND("playban", BanCommand_playban(request, arguments, command), "Force to spectate a client permanently") \
473 BAN_COMMAND("unban", BanCommand_unban(request, arguments), "Remove an existing ban") \
474 BAN_COMMAND("unmute", BanCommand_unmute(request, arguments), "Unmute a client") \
475 BAN_COMMAND("unvoteban", BanCommand_unvoteban(request, arguments), "Remove an existing voting ban") \
476 BAN_COMMAND("unplayban", BanCommand_unplayban(request, arguments), "Remove an existing forced to spectate ban") \
477 BAN_COMMAND("voteban", BanCommand_voteban(request, arguments, command), "Disallow a client from voting") \
482 #define BAN_COMMAND(name, function, description) \
483 { if (strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description); } }
491 #define BAN_COMMAND(name, function, description) \
492 { if (name == strtolower(argv(0))) { function; return true; } }
502 #define BAN_COMMAND(name, function, description) \
503 { if (name == strtolower(argv(1))) { function; return true; } }
513 #define BAN_COMMAND(name, function, description) \
514 { if (strtolower(description) != "") { CMD_Write_Alias("qc_cmd_sv", name, description); } }
void BanCommand_banlist(int request)
void BanCommand_kickban(int request, int argc, string command)
void BanCommand_macro_help()
void BanCommand_ban(int request, int argc, string command)
#define BAN_COMMANDS(request, arguments, command)
void BanCommand_playban(int request, int argc, string command)
void BanCommand_unplayban(int request, int argc)
void BanCommand_voteban(int request, int argc, string command)
void BanCommand_unban(int request, int argc)
void BanCommand_unvoteban(int request, int argc)
float BanCommand_macro_command(int argc, string command)
void BanCommand_mute(int request, int argc, string command)
void BanCommand_unmute(int request, int argc)
void BanCommand_macro_write_aliases(float fh)
float BanCommand_macro_usage(int argc)
float BanCommand(string command)
#define GET_BAN_ARG(v, d)
string autocvar_g_playban_list
bool autocvar_g_playban_minigames
string autocvar_g_voteban_list
#define GET_BAN_REASON(v, d)
string autocvar_g_chatban_list
float autocvar_g_ban_default_bantime
float autocvar_g_ban_default_masksize
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int CMD_REQUEST_COMMAND
const int CMD_REQUEST_USAGE
float Ban_Insert(string ip, float bantime, string reason, float dosync)
float Ban_Delete(float i)
void Ban_KickBanClient(entity client, float bantime, float masksize, string reason)
#define FOREACH_WORD(words, cond, body)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
bool PlayerInIDList(entity p, string idlist)
void PutObserverInServer(entity this, bool is_forced, bool use_spawnpoint)
putting a client as observer in the server
bool PlayerInIPList(entity p, string iplist)
entity GetIndexedEntity(int argc, int start_index)
int VerifyClientEntity(entity client, bool must_be_real, bool must_be_bots)
string GetCallerName(entity caller)
int VerifyKickableEntity(entity client)
#define GetClientErrorString(clienterror, original_input)
ClientState CS(Client this)
ERASEABLE string cons(string a, string b)
void part_minigame(entity player)