+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../../dpdefs/progsdefs.qh"
+ #include "../../dpdefs/dpextensions.qh"
+ #include "../../warpzonelib/mathlib.qh"
+ #include "../../common/constants.qh"
+ #include "../../common/teams.qh"
+ #include "../../common/util.qh"
+ #include "../../common/command/shared_defs.qh"
+ #include "../../common/monsters/sv_monsters.qh"
+ #include "../autocvars.qh"
+ #include "../defs.qh"
+ #include "../../common/notifications.qh"
+ #include "../mutators/mutators_include.qh"
+ #include "../../common/mapinfo.qh"
+ #include "common.qh"
+ #include "cmd.qh"
+ #include "sv_cmd.qh"
+ #include "../anticheat.qh"
+ #include "../playerdemo.qh"
+#endif
+
// =====================================================
// Server side game commands code, reworked by Samual
// Last updated: December 29th, 2011
// =====================================================
// Server side game commands code, reworked by Samual
// Last updated: December 29th, 2011
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string admin_message = argv(2);
float infobartime = stof(argv(3));
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string admin_message = argv(2);
float infobartime = stof(argv(3));
- print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
centerprint(client, strcat("^3", admin_name(), ":\n^7", admin_message));
sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n"));
}
centerprint(client, strcat("^3", admin_name(), ":\n^7", admin_message));
sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", admin_message, "\n"));
}
successful = strcat(successful, (successful ? ", " : ""), client.netname);
dprint("Message sent to ", client.netname, "\n");
continue;
}
successful = strcat(successful, (successful ? ", " : ""), client.netname);
dprint("Message sent to ", client.netname, "\n");
continue;
}
if(successful)
bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
else
print("No players given (", original_targets, ") could receive the message.\n");
if(successful)
bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
else
print("No players given (", original_targets, ") could receive the message.\n");
-
- float removed_count = 0;
- entity montokill, head;
-
- FOR_EACH_MONSTER(montokill)
- {
- WaypointSprite_Kill(montokill.sprite);
-
- if(montokill.weaponentity)
- remove(montokill.weaponentity);
-
- remove(montokill);
- removed_count += 1;
- }
-
- FOR_EACH_PLAYER(head)
- head.monstercount = 0;
-
+ if(g_invasion) { print("This command doesn't work during an invasion.\n"); return; }
+
+ float removed_count = 0;
+ entity head;
+
+ FOR_EACH_MONSTER(head)
+ {
+ monster_remove(head);
+ ++removed_count;
+ }
+
- print(strcat("Killed ", ftos(removed_count), " monster", ((removed_count == 1) ? "\n" : "s\n")));
-
+ printf("Killed %d monster%s\n", removed_count, ((removed_count == 1) ? "" : "s"));
+
{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
entity client = GetIndexedEntity(argc, 1);
{
switch(request)
{
case CMD_REQUEST_COMMAND:
{
entity client = GetIndexedEntity(argc, 1);
- print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
- print("Original size: ", ftos(world.absmin_x), " ", ftos(world.absmin_y), " ", ftos(world.absmin_z));
- print(" ", ftos(world.absmax_x), " ", ftos(world.absmax_y), " ", ftos(world.absmax_z), "\n");
- print("Currently set size: ", ftos(world.mins_x), " ", ftos(world.mins_y), " ", ftos(world.mins_z));
- print(" ", ftos(world.maxs_x), " ", ftos(world.maxs_y), " ", ftos(world.maxs_z), "\n");
+ print("Original size: ", ftos(world.absmin.x), " ", ftos(world.absmin.y), " ", ftos(world.absmin.z));
+ print(" ", ftos(world.absmax.x), " ", ftos(world.absmax.y), " ", ftos(world.absmax.z), "\n");
+ print("Currently set size: ", ftos(world.mins.x), " ", ftos(world.mins.y), " ", ftos(world.mins.z));
+ print(" ", ftos(world.maxs.x), " ", ftos(world.maxs.y), " ", ftos(world.maxs.z), "\n");
- tracebox('1 0 0' * world.absmin_x,
- '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
- '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
- '1 0 0' * world.absmax_x,
+ tracebox('1 0 0' * world.absmin.x,
+ '0 1 0' * world.absmin.y + '0 0 1' * world.absmin.z,
+ '0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z,
+ '1 0 0' * world.absmax.x,
- tracebox('0 1 0' * world.absmin_y,
- '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
- '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
- '0 1 0' * world.absmax_y,
+ tracebox('0 1 0' * world.absmin.y,
+ '1 0 0' * world.absmin.x + '0 0 1' * world.absmin.z,
+ '1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z,
+ '0 1 0' * world.absmax.y,
- tracebox('0 0 1' * world.absmin_z,
- '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
- '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
- '0 0 1' * world.absmax_z,
+ tracebox('0 0 1' * world.absmin.z,
+ '1 0 0' * world.absmin.x + '0 1 0' * world.absmin.y,
+ '1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y,
+ '0 0 1' * world.absmax.z,
- tracebox('1 0 0' * world.absmax_x,
- '0 1 0' * world.absmin_y + '0 0 1' * world.absmin_z,
- '0 1 0' * world.absmax_y + '0 0 1' * world.absmax_z,
- '1 0 0' * world.absmin_x,
+ tracebox('1 0 0' * world.absmax.x,
+ '0 1 0' * world.absmin.y + '0 0 1' * world.absmin.z,
+ '0 1 0' * world.absmax.y + '0 0 1' * world.absmax.z,
+ '1 0 0' * world.absmin.x,
- tracebox('0 1 0' * world.absmax_y,
- '1 0 0' * world.absmin_x + '0 0 1' * world.absmin_z,
- '1 0 0' * world.absmax_x + '0 0 1' * world.absmax_z,
- '0 1 0' * world.absmin_y,
+ tracebox('0 1 0' * world.absmax.y,
+ '1 0 0' * world.absmin.x + '0 0 1' * world.absmin.z,
+ '1 0 0' * world.absmax.x + '0 0 1' * world.absmax.z,
+ '0 1 0' * world.absmin.y,
- tracebox('0 0 1' * world.absmax_z,
- '1 0 0' * world.absmin_x + '0 1 0' * world.absmin_y,
- '1 0 0' * world.absmax_x + '0 1 0' * world.absmax_y,
- '0 0 1' * world.absmin_z,
+ tracebox('0 0 1' * world.absmax.z,
+ '1 0 0' * world.absmin.x + '0 1 0' * world.absmin.y,
+ '1 0 0' * world.absmax.x + '0 1 0' * world.absmax.y,
+ '0 0 1' * world.absmin.z,
print(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown
}
}
print(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown
}
}
- entity client;
- string result1 = (argv(2) ? strcat("^7", argv(1), "^3!\n") : "^1HEADS^3!\n");
- string result2 = (argv(2) ? strcat("^7", argv(2), "^3!\n") : "^4TAILS^3!\n");
+ string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
+ string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
-
- FOR_EACH_CLIENT(client)
- centerprint(client, strcat("^3Throwing coin... Result: ", choice));
- bprint(strcat("^3Throwing coin... Result: ", choice));
+
+ Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
if(accepted > 0)
{
stuffcmd(client, "defer clear\n");
print("defer clear stuffed to ", client.netname, "\n");
}
else { print("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
if(accepted > 0)
{
stuffcmd(client, "defer clear\n");
print("defer clear stuffed to ", client.netname, "\n");
}
else { print("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
- if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
+ if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
d = db_create();
print("begin of effects list\n");
db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
d = db_create();
print("begin of effects list\n");
db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
changematchtime(autocvar_timelimit_increment * 60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
changematchtime(autocvar_timelimit_increment * 60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
for(client = world; (client = find(client, classname, argv(1))); )
print(etos(client), "\n");
for(client = world; (client = find(client, classname, argv(1))); )
print(etos(client), "\n");
if(t)
{
MapInfo_SwitchGameType(t);
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
if(MapInfo_count > 0)
if(t)
{
MapInfo_SwitchGameType(t);
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
if(MapInfo_count > 0)
v = gettaginfo(tmp_entity, i);
print("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
v = gettaginfo(tmp_entity, i);
print("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
- print(" vector = ", ftos(v_x), " ", ftos(v_y), " ", ftos(v_z), "\n");
- print(" offset = ", ftos(gettaginfo_offset_x), " ", ftos(gettaginfo_offset_y), " ", ftos(gettaginfo_offset_z), "\n");
- print(" forward = ", ftos(gettaginfo_forward_x), " ", ftos(gettaginfo_forward_y), " ", ftos(gettaginfo_forward_z), "\n");
- print(" right = ", ftos(gettaginfo_right_x), " ", ftos(gettaginfo_right_y), " ", ftos(gettaginfo_right_z), "\n");
- print(" up = ", ftos(gettaginfo_up_x), " ", ftos(gettaginfo_up_y), " ", ftos(gettaginfo_up_z), "\n");
+ print(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
+ print(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
+ print(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
+ print(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
+ print(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
localcmd(strcat(argv(4), vtos(v), argv(5), "\n"));
}
}
else
print("bone not found\n");
localcmd(strcat(argv(4), vtos(v), argv(5), "\n"));
}
}
else
print("bone not found\n");
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string destination = argv(2);
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string destination = argv(2);
{
t = car(targets); targets = cdr(targets);
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
{
t = car(targets); targets = cdr(targets);
// Check to see if the player is a valid target
client = GetFilteredEntity(t);
- print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
successful = strcat(successful, (successful ? ", " : ""), client.netname);
}
else
successful = strcat(successful, (successful ? ", " : ""), client.netname);
}
else
// keep the forcing undone
print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
continue;
// keep the forcing undone
print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
continue;
{
case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
{
case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
}
default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
}
// If so, lets continue and finally move the player
client.team_forced = 0;
MoveToTeam(client, team_id, 6);
// If so, lets continue and finally move the player
client.team_forced = 0;
MoveToTeam(client, team_id, 6);
if(successful)
bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
else
print("No players given (", original_targets, ") are able to move.\n");
if(successful)
bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
else
print("No players given (", original_targets, ") are able to move.\n");
{
plr.spectatortime = time;
Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
{
plr.spectatortime = time;
Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
return;
}
bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
return;
}
- print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
- print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
case "auto_read_and_write":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
case "auto_read_and_write":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
case "auto_read":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
case "auto_read":
{
n = GetFilteredNumber(argv(3));
cvar_set("bot_number", ftos(n));
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
return;
localcmd("wait; wait; wait\n");
for(i = 0; i < n; ++i) { localcmd("sv_cmd playerdemo read ", ftos(i+2), " ", argv(2), ftos(i+1), "\n"); }
return;
changematchtime(autocvar_timelimit_decrement *-60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
changematchtime(autocvar_timelimit_decrement *-60, autocvar_timelimit_min * 60, autocvar_timelimit_max * 60);
return;
}
- float i, x, z, t_teams, t_players, team_color;
+ int i;
+ float x, z, t_teams, t_players, team_color;
if(c1 >= 0) t_teams = max(1, t_teams);
if(c2 >= 0) t_teams = max(2, t_teams);
if(c3 >= 0) t_teams = max(3, t_teams);
if(c4 >= 0) t_teams = max(4, t_teams);
if(c1 >= 0) t_teams = max(1, t_teams);
if(c2 >= 0) t_teams = max(2, t_teams);
if(c3 >= 0) t_teams = max(3, t_teams);
if(c4 >= 0) t_teams = max(4, t_teams);
for(i = 1; i <= t_teams; ++i)
{
// find out how many players to assign to this team
x = (t_players / t_teams);
x = ((i == 1) ? ceil(x) : floor(x));
for(i = 1; i <= t_teams; ++i)
{
// find out how many players to assign to this team
x = (t_players / t_teams);
x = ((i == 1) ? ceil(x) : floor(x));
MoveToTeam(self, team_color, 6);
shuffleteams_players[z] = 0;
MoveToTeam(self, team_color, 6);
shuffleteams_players[z] = 0;
if(accepted > 0)
{
stuffcmd(client, strcat("\n", argv(next_token), "\n"));
print(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n"));
}
else
if(accepted > 0)
{
stuffcmd(client, strcat("\n", argv(next_token), "\n"));
print(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n"));
}
else
- print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
-
+ print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
+
entity e;
vector org, delta, start, end, p, q, q0, pos, vv, dv;
float i, f, safe, unsafe, dq, dqf;
entity e;
vector org, delta, start, end, p, q, q0, pos, vv, dv;
float i, f, safe, unsafe, dq, dqf;
- start_x = org_x + random() * delta_x;
- start_y = org_y + random() * delta_y;
- start_z = org_z + random() * delta_z;
+ start.x = org.x + random() * delta.x;
+ start.y = org.y + random() * delta.y;
+ start.z = org.z + random() * delta.z;
- end_x = org_x + random() * delta_x;
- end_y = org_y + random() * delta_y;
- end_z = org_z + random() * delta_z;
+ end.x = org.x + random() * delta.x;
+ end.y = org.y + random() * delta.y;
+ end.z = org.z + random() * delta.z;
start = stov(vtos(start));
end = stov(vtos(end));
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
start = stov(vtos(start));
end = stov(vtos(end));
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
{
p = trace_endpos;
tracebox(p, PL_MIN, PL_MAX, p, MOVE_NOMONSTERS, world);
{
p = trace_endpos;
tracebox(p, PL_MIN, PL_MAX, p, MOVE_NOMONSTERS, world);
{
rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
{
rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
- // how much do we need to back off?
- safe = 1;
- unsafe = 0;
- for(;;)
+ pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
+ tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
+ if(trace_startsolid)
- pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
- tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
- if(trace_startsolid)
- {
- if((safe + unsafe) * 0.5 == unsafe)
- break;
- unsafe = (safe + unsafe) * 0.5;
- }
- else
- {
- if((safe + unsafe) * 0.5 == safe)
- break;
- safe = (safe + unsafe) * 0.5;
- }
+ if((safe + unsafe) * 0.5 == unsafe)
+ break;
+ unsafe = (safe + unsafe) * 0.5;
-
- print("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
- print("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
-
- tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
- if(trace_startsolid)
- print("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- print("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- break;
+ {
+ if((safe + unsafe) * 0.5 == safe)
+ break;
+ safe = (safe + unsafe) * 0.5;
+ }
+ print("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
+ print("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
+
+ tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
+ if(trace_startsolid)
+ print("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ else
+ print("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ if (++hitcount >= 10)
+ break;
+ }
+ else
+ {
print("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
print("could go ", ftos(dq), " units further to ", vtos(q), "\n");
print("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
print("could go ", ftos(dq), " units further to ", vtos(q), "\n");
dv = -1 * dv;
tracebox(vv, e.mins, e.maxs, vv + dv, MOVE_NORMAL, e);
if(trace_startsolid)
print("bug 1\n");
if(trace_fraction == 1)
dv = -1 * dv;
tracebox(vv, e.mins, e.maxs, vv + dv, MOVE_NORMAL, e);
if(trace_startsolid)
print("bug 1\n");
if(trace_fraction == 1)
- print("bug 2: ", ftos(dv_x), " ", ftos(dv_y), " ", ftos(dv_z));
- print(" (", ftos(asin(dv_z / vlen(dv)) * 180 / M_PI), " degrees)\n");
- f = dv_z;
+ print("bug 2: ", ftos(dv.x), " ", ftos(dv.y), " ", ftos(dv.z));
+ print(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)\n");
+ f = dv.z;
- if(tracewalk(e, stov(argv(1)), e.mins, e.maxs, stov(argv(2)), MOVE_NORMAL))
+ if(tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL))
traceline(vv, dv, MOVE_NORMAL, world);
trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), vv, trace_endpos);
trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dv);
return;
}
}
traceline(vv, dv, MOVE_NORMAL, world);
trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), vv, trace_endpos);
trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dv);
return;
}
}
{
CampaignLevelWarp(stof(argv(1)));
print("Successfully warped to campaign level ", stof(argv(1)), ".\n");
{
CampaignLevelWarp(stof(argv(1)));
print("Successfully warped to campaign level ", stof(argv(1)), ".\n");
// ==================================
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
// ==================================
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
#define SERVER_COMMANDS(request,arguments,command) \
SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
#define SERVER_COMMANDS(request,arguments,command) \
SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
- SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \
+ SERVER_COMMAND("mobbutcher", GameCommand_mobbutcher(request), "Instantly removes all monsters on the map") \
SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \
SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \
SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \
SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \
SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \
SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \
{
#define SERVER_COMMAND(name,function,description) \
{ print(" ^2", name, "^7: ", description, "\n"); }
{
#define SERVER_COMMAND(name,function,description) \
{ print(" ^2", name, "^7: ", description, "\n"); }
return;
}
float GameCommand_macro_command(float argc, string command)
{
#define SERVER_COMMAND(name,function,description) \
return;
}
float GameCommand_macro_command(float argc, string command)
{
#define SERVER_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return TRUE; } }
-
- SERVER_COMMANDS(CMD_REQUEST_COMMAND, argc, command)
+ { if(name == strtolower(argv(0))) { function; return true; } }
+
+ SERVER_COMMANDS(CMD_REQUEST_COMMAND, argc, command);
}
float GameCommand_macro_usage(float argc)
{
#define SERVER_COMMAND(name,function,description) \
}
float GameCommand_macro_usage(float argc)
{
#define SERVER_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return TRUE; } }
-
- SERVER_COMMANDS(CMD_REQUEST_USAGE, argc, "")
+ { if(name == strtolower(argv(1))) { function; return true; } }
+
+ SERVER_COMMANDS(CMD_REQUEST_USAGE, argc, "");
}
void GameCommand_macro_write_aliases(float fh)
{
#define SERVER_COMMAND(name,function,description) \
{ CMD_Write_Alias("qc_cmd_sv", name, description); }
}
void GameCommand_macro_write_aliases(float fh)
{
#define SERVER_COMMAND(name,function,description) \
{ CMD_Write_Alias("qc_cmd_sv", name, description); }
print("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
print("For help about a specific command, type sv_cmd help COMMAND\n");
print("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
print("For help about a specific command, type sv_cmd help COMMAND\n");
// nothing above caught the command, must be invalid
print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
// nothing above caught the command, must be invalid
print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");