51 store.cmd_floodcount += 1;
56 store.cmd_floodtime =
time;
57 store.cmd_floodcount = 1;
77 sprint(caller,
strcat(
"^1autoswitch is currently turned ", (
CS_CVAR(caller).cvar_cl_autoswitch ?
"on" :
"off"),
".\n"));
83 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
86 sprint(caller,
"\nUsage:^3 cmd autoswitch <selection>\n");
87 sprint(caller,
" Where <selection> controls if autoswitch is on or off.\n");
103 CS(caller).version = ((
argv(1) ==
"$gameversion") ? 1 :
stof(
argv(1)));
107 CS(caller).version_mismatch =
true;
117 stuffcmd(caller,
"menu_showteamselect\n");
126 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
129 sprint(caller,
"\nUsage:^3 cmd clientversion <version>\n");
130 sprint(caller,
" Where <version> is the game version reported by caller.\n");
151 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
154 sprint(caller,
"\nUsage:^3 cmd mv_getpicture <mapid>\n");
155 sprint(caller,
" Where <mapid> is the id number of the map to request an image of on the map vote selection menu.\n");
169 sprint(caller,
"ERROR: this command works only if the waypoint editor is on\n");
175 if (
argv(1) ==
"spawn")
179 sprint(caller,
"ERROR: this command works only if you are player\n");
184 else if (
argv(1) ==
"remove")
187 sprint(caller,
"ERROR: this command works only if you are player\n");
192 else if (
argv(1) ==
"hardwire")
198 else if (
argv(1) ==
"lock")
203 else if (
argv(1) ==
"unreachable")
206 sprint(caller,
"ERROR: this command works only if you are player\n");
211 else if (
argv(1) ==
"saveall")
216 else if (
argv(1) ==
"relinkall")
221 else if (
argv(1) ==
"symaxis")
223 if (
argv(2) ==
"set" ||
argv(2) ==
"get")
229 else if (
argv(1) ==
"symorigin")
231 if (
argv(2) ==
"set" ||
argv(2) ==
"get")
241 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
244 sprint(caller,
"\nUsage:^3 cmd wpeditor <action>\n");
245 sprint(caller,
" Where <action> can be:\n");
246 sprint(caller,
" ^2spawn^7: spawns a waypoint at player's position\n");
247 sprint(caller,
" ^2remove^7: removes player's nearest waypoint\n");
248 sprint(caller,
" ^2unreachable^7: reveals waypoints and items unreachable from the current position and spawnpoints without a nearest waypoint\n");
249 sprint(caller,
" ^2saveall^7: saves all waypoints and links to file\n");
250 sprint(caller,
" ^2relinkall^7: relinks all waypoints as if they were respawned\n");
251 sprint(caller,
" ^2spawn crosshair^7: spawns a waypoint at crosshair's position\n");
252 sprint(caller,
" ^7 in general useful to create special and hardwired links with ease from existing waypoints\n");
253 sprint(caller,
" ^7 in particular it's the only way to create custom jumppad waypoints (spawn another waypoint to create destination))\n");
254 sprint(caller,
" ^2spawn jump^7: spawns a jump waypoint (place it at least 60 qu before jump start, spawn another waypoint to create destination)\n");
255 sprint(caller,
" ^2spawn crouch^7: spawns a crouch waypoint (it links only to very close waypoints)\n");
256 sprint(caller,
" ^2spawn support^7: spawns a support waypoint (spawn another waypoint to create destination from which all incoming links are removed)\n");
257 sprint(caller,
" ^7 useful to replace links to problematic jumppad/teleport waypoints\n");
258 sprint(caller,
" ^2hardwire^7: marks the nearest waypoint as origin of a new hardwired link (spawn another waypoint over an existing one to create destination)\n");
259 sprint(caller,
" ^2hardwire crosshair^7: marks the waypoint at crosshair instead of the nearest waypoint\n");
260 sprint(caller,
" ^2lock^7: locks link display of the aimed waypoint (unlocks if no waypoint is found at crosshair's position)\n");
261 sprint(caller,
" ^2symorigin get|set\n");
262 sprint(caller,
" ^2symorigin get|set <p1> <p2> ... <pX>\n");
263 sprint(caller,
" ^2symaxis get|set <p1> <p2>\n");
264 sprint(caller,
" ^7 where <p1> <p2> ... <pX> are positions (\"x y z\", z can be omitted) that you know are perfectly symmetrical" 265 " so you can determine origin/axis of symmetry of maps without ctf flags or where flags aren't perfectly symmetrical\n");
266 sprint(caller,
" See ^5wpeditor_menu^7 for a selectable list of various commands and useful settings to edit waypoints.\n");
283 CS(caller).autojoin_checked = -1;
292 sprint(caller,
"\nUsage:^3 cmd join\n");
293 sprint(caller,
" No arguments required.\n");
310 sprint(caller,
"Can't die - you are already dead!\n");
322 sprint(caller,
"\nUsage:^3 cmd kill\n");
323 sprint(caller,
" No arguments required.\n");
335 string command = strtolower(
argv(1));
337 if (!autocvar_g_physics_clientselect)
339 sprint(caller,
"Client physics selection is currently disabled.\n");
343 if (command ==
"list" || command ==
"help")
345 sprint(caller,
strcat(
"Available physics sets: \n\n", autocvar_g_physics_clientselect_options,
" default\n"));
349 if (Physics_Valid(command) || command ==
"default")
352 sprint(caller,
strcat(
"^2Physics set successfully changed to ^3", command,
"\n"));
361 sprint(caller,
"\nUsage:^3 cmd physics <physics>\n");
362 sprint(caller,
" See 'cmd physics list' for available physics sets.\n");
363 sprint(caller,
" Argument 'default' resets to standard physics.\n");
379 if (
time < game_starttime)
383 caller.ready =
false;
385 bprint(playername(caller.netname, caller.team,
false),
"^2 is ^1NOT^2 ready\n");
391 bprint(playername(caller.netname, caller.team,
false),
"^2 is ready\n");
394 caller.last_ready =
time;
406 sprint(caller,
"\nUsage:^3 cmd ready\n");
407 sprint(caller,
" No arguments required.\n");
426 sprint(caller,
"\nUsage:^3 cmd say <message>\n");
427 sprint(caller,
" Where <message> is the string of text to say.\n");
447 sprint(caller,
"\nUsage:^3 cmd say_team <message>\n");
448 sprint(caller,
" Where <message> is the string of text to say.\n");
471 sprint(caller,
"^7selectteam can only be used in teamgames\n");
476 sprint(caller,
"^7selectteam can not be used as your team is forced\n");
481 sprint(caller,
"^7The game has already begun, you must wait until the next map to be able to join a team.\n");
488 if (caller.team == team_num && team_num && !
IS_DEAD(caller))
490 sprint(caller,
"^7You already are on that team.\n");
495 sprint(caller,
"^1You cannot change team, forbidden by the server.\n");
505 Send_Notification(NOTIF_ONE, caller, MSG_INFO, INFO_TEAMCHANGE_LARGERTEAM);
518 caller.team_selected =
true;
523 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
526 sprint(caller,
"\nUsage:^3 cmd selectteam <team>\n");
527 sprint(caller,
" Where <team> is the prefered team to try and join.\n");
528 sprint(caller,
" Full list of options here: red, blue, yellow, pink, auto.\n");
548 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
551 sprint(caller,
"\nUsage:^3 cmd selfstuff <command>\n");
552 sprint(caller,
" Where <command> is the string to be stuffed to your client.\n");
582 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
585 sprint(caller,
"\nUsage:^3 cmd sentcvar <cvar> <arguments>\n");
586 sprint(caller,
" Where <cvar> is the cvar plus arguments to send to the server.\n");
606 if(spec_accepted > 0 &&
IS_PLAYER(client))
610 if (caller_is_observer)
614 sprint(caller,
"Can't spectate ",
argv(1),
"^7\n");
617 sprint(caller,
"cmd spectate <client> only works when you are spectator/observer\n");
635 sprint(caller,
"\nUsage:^3 cmd spectate [<client>]\n");
636 sprint(caller,
" Where <client> can be the player to spectate.\n");
656 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
659 sprint(caller,
"\nUsage:^3 cmd suggestmap <map>\n");
660 sprint(caller,
" Where <map> is the name of the map to suggest.\n");
676 print_to(caller,
"You can't ^2tell^7 a message while connecting.");
683 if (tell_accepted > 0)
685 if (tell_to != caller)
693 string utf8_enable_save =
cvar_string(
"utf8_enable");
696 cvar_set(
"utf8_enable", utf8_enable_save);
698 Say(caller,
false, tell_to, msg,
true);
701 else {
print_to(caller,
"You can't ^2tell^7 a message to yourself.");
return; }
703 else if (
argv(1) ==
"#0")
713 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
716 sprint(caller,
"\nUsage:^3 cmd tell <client> <message>\n");
717 sprint(caller,
" Where <client> is the entity number or name of the player to send <message> to.\n");
752 VoiceMessage(caller, e, msg);
759 sprint(caller, sprintf(
"Incorrect parameters for ^2%s^7\n",
argv(0)));
762 sprint(caller,
"\nUsage:^3 cmd voice <voicetype> [<message>]\n");
763 sprint(caller,
" <voicetype> is the type of voice message, it can be one of these:\n");
765 sprint(caller,
" and <message> is the text message to send.\n");
800 #define CLIENT_COMMANDS(ent, request, arguments, command) \ 801 CLIENT_COMMAND("autoswitch", ClientCommand_autoswitch(ent, request, arguments), "Whether or not to switch automatically when getting a better weapon") \ 802 CLIENT_COMMAND("clientversion", ClientCommand_clientversion(ent, request, arguments), "Release version of the game") \ 803 CLIENT_COMMAND("join", ClientCommand_join(ent, request), "Become a player in the game") \ 804 CLIENT_COMMAND("kill", ClientCommand_kill(ent, request), "Become a member of the dead") \ 805 CLIENT_COMMAND("minigame", ClientCommand_minigame(ent, request, arguments, command), "Start a minigame") \ 806 CLIENT_COMMAND("mv_getpicture", ClientCommand_mv_getpicture(ent, request, arguments), "Retrieve mapshot picture from the server") \ 807 CLIENT_COMMAND("physics", ClientCommand_physics(ent, request, arguments), "Change physics set") \ 808 CLIENT_COMMAND("ready", ClientCommand_ready(ent, request), "Qualify as ready to end warmup stage (or restart server if allowed)") \ 809 CLIENT_COMMAND("say", ClientCommand_say(ent, request, arguments, command), "Print a message to chat to all players") \ 810 CLIENT_COMMAND("say_team", ClientCommand_say_team(ent, request, arguments, command), "Print a message to chat to all team mates") \ 811 CLIENT_COMMAND("selectteam", ClientCommand_selectteam(ent, request, arguments), "Attempt to choose a team to join into") \ 812 CLIENT_COMMAND("selfstuff", ClientCommand_selfstuff(ent, request, command), "Stuffcmd a command to your own client") \ 813 CLIENT_COMMAND("sentcvar", ClientCommand_sentcvar(ent, request, arguments), "New system for sending a client cvar to the server") \ 814 CLIENT_COMMAND("spectate", ClientCommand_spectate(ent, request), "Become an observer") \ 815 CLIENT_COMMAND("suggestmap", ClientCommand_suggestmap(ent, request, arguments), "Suggest a map to the mapvote at match end") \ 816 CLIENT_COMMAND("tell", ClientCommand_tell(ent, request, arguments, command), "Send a message directly to a player") \ 817 CLIENT_COMMAND("voice", ClientCommand_voice(ent, request, arguments, command), "Send voice message via sound") \ 818 CLIENT_COMMAND("wpeditor", ClientCommand_wpeditor(ent, request, arguments), "Waypoint editor commands") \ 823 #define CLIENT_COMMAND(name, function, description) \ 824 { sprint(caller, " ^2", name, "^7: ", description, "\n"); } 827 #undef CLIENT_COMMAND 832 #define CLIENT_COMMAND(name, function, description) \ 833 { if (name == strtolower(argv(0))) { function; return true; } } 836 #undef CLIENT_COMMAND 843 #define CLIENT_COMMAND(name, function, description) \ 844 { if (name == strtolower(argv(1))) { function; return true; } } 847 #undef CLIENT_COMMAND 854 #define CLIENT_COMMAND(name, function, description) \ 855 { CMD_Write_Alias("qc_cmd_cmd", name, description); } 858 #undef CLIENT_COMMAND 869 string command2 =
"";
870 float len =
strlen(command);
872 for (i = 0; i < len; ++i)
874 if (command != command2)
return;
887 switch (strtolower(
argv(0)))
891 case "download":
break;
892 case "mv_getpicture":
break;
893 case "wpeditor":
break;
895 case "prespawn":
break;
896 case "sentcvar":
break;
898 case "color":
case "topcolor":
case "bottomcolor":
902 Send_Notification(NOTIF_ALL,
NULL, MSG_INFO, INFO_CONNECTING, this.
netname);
907 case "c2s": Net_ClientCommand(
this, command);
return;
915 if (
argv(0) ==
"help")
919 sprint(
this,
"\nClient networked commands:\n");
922 sprint(
this,
"\nCommon networked commands:\n");
925 sprint(
this,
"\nUsage:^3 cmd <command>^7, where possible commands are listed above.\n");
926 sprint(
this,
"For help about a specific command, type cmd help <command>\n");
void ClientCommand_tell(entity caller, int request, int argc, string command)
int Team_IndexToBit(int index)
Converts team index into bit value that is used in team bitmasks.
void ClientKill_TeamChange(entity this, float targetteam)
entity GetIndexedEntity(int argc, float start_index)
bool SV_ParseClientCommand_floodcheck(entity this)
float CommonCommand_macro_usage(int argc, entity caller)
int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
message "": do not say, just test flood control return value: 1 = accept 0 = reject -1 = fake accept ...
void ClientCommand_autoswitch(entity caller, int request, int argc)
void waypoint_lock(entity pl)
const int CMD_REQUEST_USAGE
void ClientCommand_macro_help(entity caller)
void ClientCommand_selectteam(entity caller, int request, int argc)
void ClientCommand_selfstuff(entity caller, int request, string command)
void ClientKill(entity this)
int TeamBalance_FindBestTeams(entity balance, entity player, bool use_score)
Returns the bitmask of the teams that will make the game most balanced if the player joins any of the...
void TeamBalance_Destroy(entity balance)
Destroy the team balance entity.
void CommonCommand_macro_help(entity caller)
void ClientCommand_say_team(entity caller, int request, int argc, string command)
ClientState CS(Client this)
float ClientCommand_macro_command(int argc, entity caller, string command)
#define CLIENT_COMMANDS(ent, request, arguments, command)
void ClientCommand_say(entity caller, int request, int argc, string command)
float autocvar_gameversion_max
float VerifyClientEntity(entity client, float must_be_real, float must_be_bots)
void ClientCommand_voice(entity caller, int request, int argc, string command)
void waypoint_spawn_fromeditor(entity pl, bool at_crosshair, bool is_jump_wp, bool is_crouch_wp, bool is_support_wp)
bool Spectate(entity this, entity pl)
int autocvar_sv_clientcommand_antispam_count
void print_to(entity to, string input)
bool autocvar_g_changeteam_banned
void ClientCommand_macro_write_aliases(float fh)
void ClientCommand_kill(entity caller, int request)
entity GetFilteredEntity(string input)
void ClientCommand_mv_getpicture(entity caller, int request, int argc)
#define IS_REAL_CLIENT(v)
float autocvar_gameversion_min
void waypoint_getSymmetricalAxis_cmd(entity caller, bool save, int arg_idx)
bool waypointeditor_enabled
float ClientCommand_macro_usage(int argc, entity caller)
bool autocvar_g_balance_teams_prevent_imbalance
void SV_ParseClientCommand(entity this, string command)
void ClientCommand_sentcvar(entity caller, int request, int argc)
int Player_GetForcedTeamIndex(entity player)
Returns the index of the forced team of the given player.
void ClientCommand_ready(entity caller, int request)
void ClientCommand_join(entity caller, int request)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void GetCvars(entity this, entity store, int f)
void TeamBalance_GetTeamCounts(entity balance, entity ignore)
Counts the number of players and various other information about each team.
bool joinAllowed(entity this)
void ClientCommand_spectate(entity caller, int request)
const int CMD_REQUEST_COMMAND
void MapVote_SendPicture(entity to, int id)
ERASEABLE float InterpretBoolean(string input)
void waypoint_getSymmetricalOrigin_cmd(entity caller, bool save, int arg_idx)
bool Ban_MaybeEnforceBanOnce(entity client)
void waypoint_start_hardwiredlink(entity pl, bool at_crosshair)
void ClientCommand_physics(entity caller, int request, int argc)
void waypoint_unreachable(entity pl)
#define GetClientErrorString(clienterror, original_input)
int Team_TeamToIndex(int team_num)
Converts team value into team index.
float Team_ColorToTeam(string team_color)
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
string MapVote_Suggest(entity this, string m)
void ClientCommand_suggestmap(entity caller, int request, int argc)
#define INGAME_JOINED(it)
#define MUTATOR_CALLHOOK(id,...)
bool autocvar_g_balance_teams
bool intermission_running
entity TeamBalance_CheckAllowedTeams(entity for_whom)
Checks whether the player can join teams according to global configuration and mutator settings...
float CheatCommand(entity this, int argc)
entity GetVoiceMessage(string type)
void waypoint_schedulerelinkall()
void ClientCommand_clientversion(entity caller, int request, int argc)
float autocvar_sv_clientcommand_antispam_time
void ClientCommand_wpeditor(entity caller, int request, int argc)
void waypoint_remove_fromeditor(entity pl)
float CommonCommand_macro_command(int argc, entity caller, string command)