X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fgamecommand.qc;h=c8d2af14368d49bd1aabe54840822db95e1499d8;hb=1a507acfe146c88e76d252ddec4242210ac8923f;hp=e1d7cb15df518149d7665ef07918f80dd8ade1e9;hpb=7ef3afe5cd584fb87dd45a1bc014da913d4f117a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/gamecommand.qc b/qcsrc/server/gamecommand.qc index e1d7cb15d..c8d2af143 100644 --- a/qcsrc/server/gamecommand.qc +++ b/qcsrc/server/gamecommand.qc @@ -665,7 +665,35 @@ void changematchtime(float delta, float mi, float ma) return; } - cvar_set("timelimit", ftos(new)); + cvar_set("timelimit", ftos(new / 60)); +} + +float g_clientmodel_genericsendentity (entity to, float sf); +void modelbug_make_svqc(); +void modelbug_make_csqc() +{ + Net_LinkEntity(self, TRUE, 0, g_clientmodel_genericsendentity); + self.think = modelbug_make_svqc; + self.nextthink = time + 1; + setorigin(self, self.origin - '0 0 8'); +} +void modelbug_make_svqc() +{ + self.SendEntity = func_null; + self.think = modelbug_make_csqc; + self.nextthink = time + 1; + setorigin(self, self.origin + '0 0 8'); +} + +void modelbug() +{ + entity e; + e = spawn(); + setorigin(e, nextent(world).origin); + precache_model("models_portal.md3"); + setmodel(e, "models/portal.md3"); + e.think = modelbug_make_svqc; + e.nextthink = time + 1; } void GameCommand(string command) @@ -680,7 +708,7 @@ void GameCommand(string command) if(argv(0) == "help" || argc == 0) { print("Usage: sv_cmd COMMAND..., where possible commands are:\n"); - print(" adminmsg clientnumber \"message\"\n"); + print(" adminmsg clientnumber \"message\" [infobartime]\n"); print(" teamstatus\n"); print(" printstats\n"); print(" make_mapinfo\n"); @@ -761,24 +789,40 @@ void GameCommand(string command) } if(argv(0) == "adminmsg") - if(argc == 3) + if(argc >= 3 && argc <= 4) { entno = stof(argv(1)); - if((entno < 1) | (entno > maxclients)) { + if((entno < 0) | (entno > maxclients)) { print("Player ", argv(1), " doesn't exist\n"); return; } - client = edict_num(entno); - - if(client.flags & FL_CLIENT) + n = 0; + for(i = (entno ? entno : 1); i <= (entno ? entno : maxclients); ++i) { - centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3", admin_name(), ":\n\n^7", argv(2))); - sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", argv(2), "\n")); - print("Message sent to ", client.netname, "\n"); + client = edict_num(i); + if(client.flags & FL_CLIENT) + { + if(argc == 4) + { + s = argv(2); + s = strreplace("\n", "", s); + s = strreplace("\\", "\\\\", s); + s = strreplace("$", "$$", s); + s = strreplace("\"", "\\\"", s); + stuffcmd(client, sprintf("\ninfobar %f \"%s\"\n", stof(argv(3)), s)); + } + else + { + centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3", admin_name(), ":\n\n^7", argv(2))); + sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: ", argv(2), "\n")); + } + print("Message sent to ", client.netname, "\n"); + ++n; + } } - else + if(!n) print("Client not found\n"); return; @@ -824,7 +868,7 @@ void GameCommand(string command) if (argv(0) == "lockteams") { - if(teams_matter) + if(teamplay) { lockteams = 1; bprint("^1The teams are now locked.\n"); @@ -836,7 +880,7 @@ void GameCommand(string command) if (argv(0) == "unlockteams") { - if(teams_matter) + if(teamplay) { lockteams = 0; bprint("^1The teams are now unlocked.\n"); @@ -855,7 +899,7 @@ void GameCommand(string command) // 2 (10) no centerprint, admin message // 3 (11) no centerprint, no admin message - if(!teams_matter) { // death match + if(!teamplay) { // death match print("Currently not playing a team game\n"); return; } @@ -1435,6 +1479,12 @@ void GameCommand(string command) return; } + if(argv(0) == "modelbug") + { + modelbug(); + return; + } + print("Invalid command. For a list of supported commands, try sv_cmd help.\n"); }