#include <server/command/radarmap.qh>
#include <server/intermission.qh>
#include <server/ipban.qh>
+#include <server/mapvoting.qh>
#include <server/mutators/_mod.qh>
#include <server/player.qh>
#include <server/scores_rules.qh>
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
entity client;
float accepted;
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd adminmsg <clients> \"<message>\" [<infobartime>]");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if(warmup_stage)
{
ReadyRestart(true);
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
string reason = argv(1);
int n = 0;
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
entity client = GetIndexedEntity(argc, 1);
float accepted = VerifyClientEntity(client, false, false);
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd anticheat <client>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
entity bot;
if (argv(1) == "reset")
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd bot_cmd <client> <command> [<arguments>]");
LOG_HELP(" <client> can be either the name of the bot or a progressive number (not the entity number!)");
LOG_HELP(" can also be '*' or 'all' to allow sending the command to all the bots");
LOG_HELP(" For full list of commands, see bot_cmd help [<command>].");
- LOG_HELP("Examples: sv_cmd bot_cmd 1 cc \"say something\"");
+ LOG_HELP("Examples: sv_cmd bot_cmd 1 cc say something");
LOG_HELP(" sv_cmd bot_cmd 1 presskey jump");
LOG_HELP(" sv_cmd bot_cmd * pause");
return;
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
string choice = ((random() > 0.5) ? result1 : result2);
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd database <action> <filename>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
entity client;
float accepted;
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd defer_clear <client>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
int n = 0;
int argc;
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd delrec <ranking> [<map>]");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
changematchtime(autocvar_timelimit_increment * 60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
{
if (!world_initialized)
{
- LOG_INFOF("This command works only when the server is running.");
+ LOG_HELPF("This command works only when the server is running.");
return;
}
if (argv(1) != "")
{
string s = argv(1);
- Gametype t = MapInfo_Type_FromString(s, false), tsave = MapInfo_CurrentGametype();
+ Gametype t = MapInfo_Type_FromString(s, false, false);
if (t)
{
- MapInfo_SwitchGameType(t);
- MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
- if (MapInfo_count > 0)
- {
- // update lsmaps in case the gametype changed, this way people can easily list maps for it
- if (lsmaps_reply != "") strunzone(lsmaps_reply);
- lsmaps_reply = strzone(getlsmaps());
- bprint("Game type successfully switched to ", s, "\n");
- }
- else
- {
- bprint("Cannot use this game type: no map for it found\n");
- MapInfo_SwitchGameType(tsave);
- MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
- }
+ // don't execute gametype hooks because they can change active
+ // gametype rules if executed during the game
+ GameTypeVote_SetGametype(t, "", false);
}
else
- {
bprint("Failed to switch to ", s, ": this game type does not exist!\n");
- }
return;
}
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd gametype <mode>");
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd gettaginfo <model> <frame> <index> [<command1>] [<command2>]");
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd animbench <model> <frame1> <frame2>");
{
if (!world_initialized)
{
- LOG_INFOF("This command works only when the server is running.");
+ LOG_HELPF("This command works only when the server is running.");
return;
}
if (argv(1))
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd gotomap <map>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if (teamplay)
{
lockteams = 1;
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
float accepted;
entity client;
else if (destination == "spectator")
{
string pl_name = playername(client.netname, client.team, false);
- if (!IS_SPEC(client) && !IS_OBSERVER(client))
+ if (!(IS_SPEC(client) || IS_OBSERVER(client)) || INGAME(client))
{
PutObserverInServer(client, true, true);
if (team_num == client.team) // already on the destination team
{
// keep the forcing undone
- LOG_INFO("Player #", client_num_str, " (", pl_name, ") is already on the ", Team_ColoredFullName(team_num), "^7.");
+ LOG_INFO("Player #", client_num_str, " (", pl_name, ") is already on the ",
+ Team_ColoredFullName(team_num), ".");
continue;
}
else if (team_num == 0) // auto team
}
if (!TeamBalance_IsTeamAllowed(balance, team_id))
{
- LOG_INFO("Player #", client_num_str, " (", pl_name, ") is not allowed to join the ", Team_ColoredFullName(team_num), "^7.");
+ LOG_INFO("Player #", client_num_str, " (", pl_name, ") is not allowed to join the ",
+ Team_ColoredFullName(team_num), ".");
TeamBalance_Destroy(balance);
continue;
}
if (MoveToTeam(client, team_id, 6))
{
successful = strcat(successful, (successful ? ", " : ""), pl_name);
- LOG_INFO("Player #", client_num_str, " (", pl_name, ") has been moved to the ", Team_ColoredFullName(team_num), "^7.");
+ LOG_INFO("Player #", client_num_str, " (", pl_name, ") has been moved to the ",
+ Team_ColoredFullName(team_num), ".");
}
else
{
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd moveplayer <clients> <destination>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
blockSpectators = 1;
// give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_SPEC(it) || IS_OBSERVER(it)) && !INGAME(it), {
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
DumpStats(false);
LOG_INFO("stats dumped.");
return;
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
changematchtime(autocvar_timelimit_decrement * -60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd setbots <botnumber>");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if (shuffleteams_on_reset_map)
{
bprint("Players will be shuffled when this round is over.\n");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
ReadyRestart(false);
return;
}
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if (argv(2))
{
entity client = GetIndexedEntity(argc, 1);
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd stuffto <client> \"<command>\"");
}
default:
- LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
+ LOG_HELPF("Incorrect parameters for ^2%s^7", argv(0));
case CMD_REQUEST_USAGE:
{
LOG_HELP("Usage:^3 sv_cmd trace <command> [<startpos> <endpos>] [<endpos_height>]");
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if (teamplay)
{
lockteams = 0;
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
if (autocvar_g_campaign)
{
if (argc >= 2)
{
case CMD_REQUEST_COMMAND:
{
+ if (!world_initialized)
+ {
+ LOG_HELPF("This command works only when the server is running.");
+ return;
+ }
return;
}