1 string GotoMap(string m);
11 print("begin of effects list\n");
12 db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
13 db_put(d, "TE_GUNSHOTQUAD", "1"); print("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n");
14 db_put(d, "TE_SPIKE", "1"); print("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n");
15 db_put(d, "TE_SPIKEQUAD", "1"); print("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n");
16 db_put(d, "TE_SUPERSPIKE", "1"); print("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n");
17 db_put(d, "TE_SUPERSPIKEQUAD", "1"); print("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
18 db_put(d, "TE_WIZSPIKE", "1"); print("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n");
19 db_put(d, "TE_KNIGHTSPIKE", "1"); print("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n");
20 db_put(d, "TE_EXPLOSION", "1"); print("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n");
21 db_put(d, "TE_EXPLOSIONQUAD", "1"); print("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
22 db_put(d, "TE_TAREXPLOSION", "1"); print("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n");
23 db_put(d, "TE_TELEPORT", "1"); print("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n");
24 db_put(d, "TE_LAVASPLASH", "1"); print("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n");
25 db_put(d, "TE_SMALLFLASH", "1"); print("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n");
26 db_put(d, "TE_FLAMEJET", "1"); print("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n");
27 db_put(d, "EF_FLAME", "1"); print("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n");
28 db_put(d, "TE_BLOOD", "1"); print("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n");
29 db_put(d, "TE_SPARK", "1"); print("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n");
30 db_put(d, "TE_PLASMABURN", "1"); print("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n");
31 db_put(d, "TE_TEI_G3", "1"); print("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n");
32 db_put(d, "TE_TEI_SMOKE", "1"); print("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n");
33 db_put(d, "TE_TEI_BIGEXPLOSION", "1"); print("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
34 db_put(d, "TE_TEI_PLASMAHIT", "1"); print("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
35 db_put(d, "EF_STARDUST", "1"); print("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n");
36 db_put(d, "TR_ROCKET", "1"); print("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n");
37 db_put(d, "TR_GRENADE", "1"); print("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n");
38 db_put(d, "TR_BLOOD", "1"); print("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n");
39 db_put(d, "TR_WIZSPIKE", "1"); print("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n");
40 db_put(d, "TR_SLIGHTBLOOD", "1"); print("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n");
41 db_put(d, "TR_KNIGHTSPIKE", "1"); print("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n");
42 db_put(d, "TR_VORESPIKE", "1"); print("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n");
43 db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
44 db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
45 db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
46 db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
48 fh = fopen("effectinfo.txt", FILE_READ);
49 while((s = fgets(fh)))
52 if(argv(0) == "effect")
54 if(db_get(d, argv(1)) != "1")
56 if(particleeffectnum(argv(1)) >= 0)
57 print("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n");
58 db_put(d, argv(1), "1");
62 print("end of effects list\n");
67 void make_mapinfo_Think()
69 if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 1))
71 print("Done rebuiling mapinfos.\n");
72 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
77 self.think = make_mapinfo_Think;
78 self.nextthink = time;
82 void GameCommand(string command)
87 argc = tokenize(command);
89 if(argv(0) == "help" || argc == 0)
91 print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
92 print(" adminmsg clientnumber \"message\"\n");
93 print(" teamstatus\n");
94 print(" printstats\n");
95 print(" make_mapinfo\n");
96 print(" gametype dm|ctf|...\n");
97 print(" savedb filename\n");
98 print(" dumpdb filename\n");
99 print(" loaddb filename\n");
100 print(" allready\n");
101 print(" effectindexdump\n");
102 GameCommand_Vote("help", world);
103 GameCommand_Ban("help");
104 GameCommand_Generic("help");
108 if(GameCommand_Vote(command, world))
111 if(GameCommand_Ban(command))
114 if(GameCommand_Generic(command))
117 if(argv(0) == "printstats")
123 if(argv(0) == "make_mapinfo")
127 e.classname = "make_mapinfo";
128 e.think = make_mapinfo_Think;
134 if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
136 CampaignLevelWarp(stof(argv(1)));
140 if(argv(0) == "gotomap") if(argc == 2)
142 print(GotoMap(argv(1)), "\n");
146 if(argv(0) == "gametype") if(argc == 2)
151 t = MapInfo_Type_FromString(s);
152 tsave = MapInfo_CurrentGametype();
155 MapInfo_SwitchGameType(t);
156 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
157 if(MapInfo_count > 0)
159 bprint("Game type successfully switched to ", s, "\n");
163 bprint("Cannot use this game type: no map for it found\n");
164 MapInfo_SwitchGameType(tsave);
165 MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), 0);
169 bprint("Game type switch to ", s, " failed: this type does not exist!\n");
173 if(argv(0) == "adminmsg") if(argc == 3)
175 entno = stof(argv(1));
177 if(entno <= maxclients)
178 client = edict_num(entno);
179 if(client.flags & FL_CLIENT)
181 centerprint_atprio(client, CENTERPRIO_ADMIN, strcat("^3SERVER ADMIN:\n\n^7", argv(2)));
182 sprint(client, strcat("\{1}\{13}^3SERVER ADMIN^7: ", argv(2), "\n"));
183 print("Message sent to ", client.netname, "\n");
186 print("Client not found\n");
190 if(argv(0) == "savedb") if(argc == 2)
192 db_save(ServerProgsDB, argv(1));
193 print("DB saved.\n");
197 if(argv(0) == "dumpdb") if(argc == 2)
199 db_dump(ServerProgsDB, argv(1));
200 print("DB dumped.\n");
204 if(argv(0) == "loaddb") if(argc == 2)
206 db_close(ServerProgsDB);
207 ServerProgsDB = db_load(argv(1));
208 print("DB loaded.\n");
211 if (argv(0) == "nospectators")
215 FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
217 if(plr.classname == "spectator" || plr.classname == "observer")
219 plr.spectatortime = time;
220 sprint(plr, strcat("^7You have to become a player within the next ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
223 bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(cvar("g_maxplayers_spectator_blocktime")), " seconds!\n"));
226 if (argv(0) == "lockteams")
231 bprint("^1The teams are now locked.\n");
234 bprint("That command can only be used in a team-based gamemode.\n");
237 if (argv(0) == "unlockteams")
242 bprint("^1The teams are now unlocked.\n");
245 bprint("That command can only be used in a team-based gamemode.\n");
248 if (argv(0) == "movetoteam") if(argc == 3)
250 entno = stof(argv(1));
252 if(entno <= maxclients)
253 client = edict_num(entno);
254 if(client.flags & FL_CLIENT)
261 SV_ParseClientCommand(strcat("selectteam ", argv(2)));
266 print("Client not found\n");
269 if (argv(0) == "teamstatus")
271 Score_NicePrint(world);
274 if (argv(0) == "allready")
279 if (argv(0) == "effectindexdump")
285 print("Invalid command. For a list of supported commands, try sv_cmd help.\n");