if(successful)
bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
else
- print("No players given (", original_targets, ") could recieve the message.\n");
+ print("No players given (", original_targets, ") could receive the message.\n");
return;
}
}
}
-void GameCommand_bot_cmd(float request, float argc)
+void GameCommand_bot_cmd(float request, float argc, string command)
{
switch(request)
{
bot_resetqueues();
return;
}
+ else if(argv(1) == "setbots")
+ {
+ cvar_settemp("bot_vs_human", "0");
+ cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", "0");
+ bot_fixcount();
+ cvar_settemp("bot_number", argv(2));
+ if(!bot_fixcount())
+ print("Sorry, could not set requested bot count\n");
+ return;
+ }
else if(argv(1) == "load" && argc == 3)
{
float fh, i;
}
else if(argv(2) == "setbots")
{
+ cvar_settemp("bot_vs_human", "0");
cvar_settemp("minplayers", "0");
+ cvar_settemp("bot_number", "0");
+ bot_fixcount();
cvar_settemp("bot_number", argv(3));
if(!bot_fixcount())
print("Sorry, could not set requested bot count\n");
if(bot == world)
bot = find_bot_by_name(argv(2));
if(bot)
- bot_queuecommand(bot, strcat(argv(3), " ", argv(4)));
+ bot_queuecommand(bot, substring(s, argv_start_index(3), -1));
}
}
else
bot = find_bot_by_name(argv(1));
if(bot)
{
- print(strcat("Command '", strcat(argv(2), " ", argv(3)), "' sent to bot ", bot.netname, "\n"));
- bot_queuecommand(bot, strcat(argv(2), " ", argv(3)));
+ print(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
+ bot_queuecommand(bot, substring(command, argv_start_index(2), -1));
return;
}
else
}
}
+void GameCommand_animbench(float request, float argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ entity tmp_entity;
+ float i;
+ vector v;
+
+ if(argc >= 4)
+ {
+ tmp_entity = spawn();
+ if(argv(1) == "w")
+ setmodel(tmp_entity, (nextent(world)).weaponentity.model);
+ else
+ {
+ precache_model(argv(1));
+ setmodel(tmp_entity, argv(1));
+ }
+ float f1 = stof(argv(2));
+ float f2 = stof(argv(3));
+ float t0;
+ float t1 = 0;
+ float t2 = 0;
+ float n = 0;
+
+ while(t1 + t2 < 1)
+ {
+ tmp_entity.frame = f1;
+ t0 = gettime(GETTIME_HIRES);
+ getsurfacepoint(tmp_entity, 0, 0);
+ t1 += gettime(GETTIME_HIRES) - t0;
+ tmp_entity.frame = f2;
+ t0 = gettime(GETTIME_HIRES);
+ getsurfacepoint(tmp_entity, 0, 0);
+ t2 += gettime(GETTIME_HIRES) - t0;
+ n += 1;
+ }
+ print("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
+ print("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
+
+ remove(tmp_entity);
+ return;
+ }
+ }
+
+ default:
+ print("Incorrect parameters for ^2gettaginfo^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+ print("See also: ^2bbox, trace^7\n");
+ return;
+ }
+ }
+}
+
void GameCommand_gotomap(float request, float argc)
{
switch(request)
{
if(argv(2))
{
- entity client = GetIndexedEntity(argc, 1));
+ entity client = GetIndexedEntity(argc, 1);
float accepted = VerifyClientEntity(client, TRUE, FALSE);
if(accepted > 0)
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("animbench", GameCommand_animbench(request, arguments), "Benchmark model animation (LAGS)") \
SERVER_COMMAND("bbox", GameCommand_bbox(request), "Print detailed information about world size") \
- SERVER_COMMAND("bot_cmd", GameCommand_bot_cmd(request, arguments), "Control and send commands to bots") \
+ SERVER_COMMAND("bot_cmd", GameCommand_bot_cmd(request, arguments, command), "Control and send commands to bots") \
SERVER_COMMAND("cointoss", GameCommand_cointoss(request, arguments), "Flip a virtual coin and give random result") \
SERVER_COMMAND("database", GameCommand_database(request, arguments), "Extra controls of the serverprogs database") \
SERVER_COMMAND("defer_clear", GameCommand_defer_clear(request, arguments), "Clear all queued defer commands for a specific client") \