#endif
}
+void LocalCommand_create_scrshot_ent(float request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ float fh;
+ string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
+ fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ fputs(fh, "{\n");
+ fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
+ fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin_x), " ", ftos(view_origin_y), " ", ftos(view_origin_z)), "\"\n"));
+ fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles_x), " ", ftos(view_angles_y), " ", ftos(view_angles_z)), "\"\n"));
+ fputs(fh, "}\n");
+
+ print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+
+ fclose(fh);
+ }
+ else
+ {
+ print("^1Error: ^7Could not dump to file!\n");
+ }
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+ print(" No arguments required.\n");
+ return;
+ }
+ }
+}
+
void LocalCommand_debugmodel(float request, float argc)
{
switch(request)
case "radar":
{
- hud_panel_radar_maximized = (argv(2) ? InterpretBoolean(argv(2)) : !hud_panel_radar_maximized);
+ if(argv(2))
+ hud_panel_radar_maximized = InterpretBoolean(argv(2));
+ else
+ hud_panel_radar_maximized = !hud_panel_radar_maximized;
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- Cmd_MapVote_MapDownload(argc);
- return;
+ if(argv(1))
+ {
+ Cmd_MapVote_MapDownload(argc);
+ return;
+ }
}
default:
+ print("Incorrect parameters for ^2mv_download^7\n");
case CMD_REQUEST_USAGE:
{
print("\nUsage:^3 cl_cmd mv_download mapid\n");
{
case CMD_REQUEST_COMMAND:
{
- // W_FixWeaponOrder will trash argv, so save what we need.
- string thiscvar = strzone(argv(1));
- string s = cvar_string(thiscvar);
-
- if(thiscvar == "cl_weaponpriority")
- s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
- else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
- s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
+ if(argv(1))
+ {
+ // W_FixWeaponOrder will trash argv, so save what we need.
+ string thiscvar = strzone(argv(1));
+ string s = cvar_string(thiscvar);
- localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
- strunzone(thiscvar);
- return;
+ if(thiscvar == "cl_weaponpriority")
+ s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
+ else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
+ s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
+
+ localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
+ strunzone(thiscvar);
+ return;
+ }
}
default:
+ print("Incorrect parameters for ^2sendcvar^7\n");
case CMD_REQUEST_USAGE:
{
print("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
// Macro system for client commands
// ==================================
-// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
+// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
+// but for 0.5 compat, we need vyes and vno here as they were replaced... REMOVE THEM AFTER 0.6 RELEASE!!!!
#define CLIENT_COMMANDS(request,arguments) \
CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
+ CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
+ CLIENT_COMMAND("vyes", LocalCommand_handlevote(request, tokenize_console("handlevote yes")), "") \
+ CLIENT_COMMAND("vno", LocalCommand_handlevote(request, tokenize_console("handlevote no")), "") \
/* nothing */
void LocalCommand_macro_help()
{
#define CLIENT_COMMAND(name,function,description) \
- { print(" ^2", name, "^7: ", description, "\n"); }
+ { if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } }
CLIENT_COMMANDS(0, 0)
#undef CLIENT_COMMAND
void LocalCommand_macro_write_aliases(float fh)
{
#define CLIENT_COMMAND(name,function,description) \
- { CMD_Write_Alias("cl_cmd", name, description); }
+ { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
CLIENT_COMMANDS(0, 0)
#undef CLIENT_COMMAND
// Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it.
return FALSE;
-}
\ No newline at end of file
+}