2 entity ctf_worldflaglist; // CTF flags in the map
3 .entity ctf_worldflagnext;
5 .float next_take_time; // the next time a player can pick up a flag (time + blah)
6 /// I used this, in part, to fix the looping score bug. - avirox
7 //float FLAGSCORE_PICKUP = 1;
8 //float FLAGSCORE_RETURN = 5; // returned by owner team
9 //float FLAGSCORE_RETURNROGUE = 10; // returned by rogue team
10 //float FLAGSCORE_CAPTURE = 5;
11 //float FLAGSCORE_CAPTURE_TEAM = 20;
13 #define FLAG_CARRY_POS '-15 0 7'
15 void FakeTimeLimit(entity e, float t)
18 WriteByte(MSG_ONE, 3); // svc_updatestat
19 WriteByte(MSG_ONE, 236); // STAT_TIMELIMIT
21 WriteCoord(MSG_ONE, cvar("timelimit"));
23 WriteCoord(MSG_ONE, (t + 1) / 60);
26 float flagcaptimerecord;
27 .float flagpickuptime;
37 self.t_width = 0.1; // frame animation rate
39 self.t_length = 119; // maximum frame
41 setattachment(self, world, "");
42 self.mdl = self.model;
44 self.solid = SOLID_TRIGGER;
45 self.movetype = MOVETYPE_NONE;
46 self.velocity = '0 0 0';
47 self.origin_z = self.origin_z + 6;
48 self.think = FlagThink;
49 self.touch = FlagTouch;
50 self.nextthink = time + 0.1;
52 self.mangle = self.angles;
53 self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP;
54 //self.effects = self.effects | EF_DIMLIGHT;
57 self.movetype = MOVETYPE_TOSS;
60 dprint("Flag fell out of level at ", vtos(self.origin), "\n");
65 self.oldorigin = self.origin;
68 void LogCTF(string mode, float flagteam, entity actor)
71 if(!cvar("sv_eventlog"))
73 s = strcat(":ctf:", mode);
74 s = strcat(s, ":", ftos(flagteam));
76 s = strcat(s, ":", ftos(actor.playerid));
77 GameLogEcho(s, FALSE);
80 void RegenFlag(entity e)
82 setattachment(e, world, "");
83 e.movetype = MOVETYPE_NONE;
85 e.movetype = MOVETYPE_TOSS;
86 e.solid = SOLID_TRIGGER;
87 // TODO: play a sound here
88 setorigin(e, e.oldorigin);
92 e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
95 void ReturnFlag(entity e)
98 if (e.owner.flagcarried == e)
100 WaypointSprite_DetachCarrier(e.owner);
101 e.owner.flagcarried = world;
104 FakeTimeLimit(e.owner, -1);
110 void DropFlag(entity e)
122 dprint("FLAG: drop - no owner?!?!\n");
126 if (p.flagcarried != e)
128 dprint("FLAG: drop - owner is not carrying this flag??\n");
131 bprint(p.netname, "^7 lost the ", e.netname, "\n");
133 if(cvar("g_ctf_flagpenalty_drop"))
134 UpdateFrags(p, -cvar("g_ctf_flagpenalty_drop"));
136 //if(e.enemy && e.enemy != e)
137 //UpdateFrags(e.enemy, cvar("g_ctf_flagscore_kill"));
138 WaypointSprite_DetachCarrier(p);
139 LogCTF("dropped", p.team, p.flagcarried);
141 setattachment(e, world, "");
143 if (p.flagcarried == e)
144 p.flagcarried = world;
147 e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
148 e.solid = SOLID_TRIGGER;
149 e.movetype = MOVETYPE_TOSS;
150 // setsize(e, '-16 -16 0', '16 16 74');
151 setorigin(e, p.origin - '0 0 24' + '0 0 37');
152 e.cnt = FLAG_DROPPED;
153 e.velocity = '0 0 300';
154 e.pain_finished = time + cvar("g_ctf_flag_returntime");//30;
156 trace_startsolid = FALSE;
157 tracebox(e.origin, e.mins, e.maxs, e.origin, TRUE, e);
159 dprint("FLAG FALLTHROUGH will happen SOON\n");
164 if(self.delay > time)
166 self.delay = time + self.t_width;
167 if(self.nextthink > self.delay)
168 self.nextthink = self.delay;
170 self.frame = self.frame + 1;
171 if(self.frame > self.t_length)
179 self.nextthink = time + 0.1;
183 if(self.speedrunning)
184 if(self.cnt == FLAG_CARRY)
187 if(flagcaptimerecord)
188 if(time >= self.flagpickuptime + flagcaptimerecord)
190 bprint("The ", self.netname, " became impatient after ", ftos_decimals(flagcaptimerecord, 2), " seconds and returned itself\n");
192 self.owner.impulse = 77; // returning!
202 if (self.cnt == FLAG_BASE)
205 if (self.cnt == FLAG_DROPPED)
207 // flag fallthrough? FIXME remove this if bug is really fixed now
208 if(self.origin_z < -131072)
210 dprint("FLAG FALLTHROUGH just happened\n");
211 self.pain_finished = 0;
213 setattachment(self, world, "");
214 if (time > self.pain_finished)
216 bprint("The ", self.netname, " has returned to base\n");
217 sound (e, CHAN_AUTO, self.noise3, 1, ATTN_NONE);
218 LogCTF("returned", self.team, world);
225 if (e.classname != "player" || (e.deadflag) || (e.flagcarried != self))
227 dprint("CANNOT HAPPEN - player dead and STILL had a flag!\n");
240 local string s, s0, h0, h1;
241 if (other.classname != "player")
243 if (other.health < 1) // ignore dead players
246 if (self.cnt == FLAG_CARRY)
249 if (self.cnt == FLAG_BASE)
250 if (other.team == self.team)
251 if (other.flagcarried) // he's got a flag
252 if (other.flagcarried.team != self.team) // capture
254 if (other.flagcarried == world)
258 t = time - other.flagcarried.flagpickuptime;
259 s = ftos_decimals(t, 2);
260 s0 = ftos_decimals(flagcaptimerecord, 2);
261 h0 = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
266 h0 = strcat(h0, "^7's"); // h0: display text for previous netname
267 if (flagcaptimerecord == 0)
269 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, " seconds\n");
270 flagcaptimerecord = t;
271 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
272 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
274 else if (t < flagcaptimerecord)
276 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", breaking ", strcat(h0, " previous record of ", s0, " seconds\n"));
277 flagcaptimerecord = t;
278 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(t));
279 db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), h1);
283 bprint(other.netname, "^7 captured the ", other.flagcarried.netname, " in ", s, ", failing to break ", strcat(h0, " record of ", s0, " seconds\n"));
286 PlayerTeamScore_Add(other, SP_CTF_CAPS, ST_CTF_CAPS, 1);
287 LogCTF("capture", other.flagcarried.team, other);
288 // give credit to the individual player
289 UpdateFrags(other, cvar("g_ctf_flagscore_capture"));
291 // give credit to all players of the team (rewards large teams)
292 // NOTE: this defaults to 0
293 FOR_EACH_PLAYER(head)
294 if (head.team == self.team)
295 UpdateFrags(head, cvar("g_ctf_flagscore_capture_team"));
297 sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NONE);
298 WaypointSprite_DetachCarrier(other);
299 if(self.speedrunning)
300 FakeTimeLimit(other, -1);
301 RegenFlag (other.flagcarried);
302 other.flagcarried = world;
303 other.next_take_time = time + 1;
305 if (self.cnt == FLAG_BASE)
306 if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2) // only red and blue team can steal flags
307 if (other.team != self.team)
308 if (!other.flagcarried)
310 if (other.next_take_time > time)
313 self.flagpickuptime = time; // used for timing runs
314 self.speedrunning = other.speedrunning; // if speedrunning, flag will self-return and teleport the owner back after the record
315 if(other.speedrunning)
316 if(flagcaptimerecord)
317 FakeTimeLimit(other, time + flagcaptimerecord);
318 self.solid = SOLID_NOT;
319 setorigin(self, self.origin); // relink
321 other.flagcarried = self;
322 self.cnt = FLAG_CARRY;
323 self.angles = '0 0 0';
324 bprint(other.netname, "^7 got the ", self.netname, "\n");
325 UpdateFrags(other, cvar("g_ctf_flagscore_pickup"));
326 PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
327 LogCTF("steal", self.team, other);
328 sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE);
330 FOR_EACH_PLAYER(player)
331 if(player.team == self.team)
332 centerprint(player, "The enemy got your flag! Retrieve it!");
334 self.movetype = MOVETYPE_NONE;
335 setorigin(self, FLAG_CARRY_POS);
336 setattachment(self, other, "");
337 WaypointSprite_AttachCarrier("flagcarrier", other);
342 if (self.cnt == FLAG_DROPPED)
344 self.flags = FL_ITEM; // clear FL_ONGROUND and any other junk
345 if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
348 bprint(other.netname, "^7 returned the ", self.netname, "\n");
349 if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2)
350 UpdateFrags(other, cvar("g_ctf_flagscore_return"));
352 UpdateFrags(other, cvar("g_ctf_flagscore_return_rogue"));
353 PlayerScore_Add(other, SP_CTF_RETURNS, 1);
354 LogCTF("return", self.team, other);
355 sound (self, CHAN_AUTO, self.noise1, 1, ATTN_NONE);
358 else if (!other.flagcarried)
361 self.solid = SOLID_NOT;
362 setorigin(self, self.origin); // relink
364 other.flagcarried = self;
365 self.cnt = FLAG_CARRY;
366 bprint(other.netname, "^7 picked up the ", self.netname, "\n");
367 UpdateFrags(other, cvar("g_ctf_flagscore_pickup"));
368 LogCTF("pickup", self.team, other);
369 sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE);
371 FOR_EACH_PLAYER(player)
372 if(player.team == self.team)
373 centerprint(player, "The enemy got your flag! Retrieve it!");
375 self.movetype = MOVETYPE_NONE; // flag must have MOVETYPE_NONE here, otherwise it will drop through the floor...
376 setorigin(self, FLAG_CARRY_POS);
377 setattachment(self, other, "");
378 WaypointSprite_AttachCarrier("flagcarrier", other);
383 /*QUAKED spawnfunc_info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24)
384 CTF Starting point for a player
389 viewing angle when spawning
391 void spawnfunc_info_player_team1()
393 self.team = COLOR_TEAM1; // red
394 spawnfunc_info_player_deathmatch();
396 //self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();};
398 /*QUAKED spawnfunc_info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24)
399 CTF Starting point for a player in
404 viewing angle when spawning
406 void spawnfunc_info_player_team2()
408 self.team = COLOR_TEAM2; // blue
409 spawnfunc_info_player_deathmatch();
411 //self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();};
413 /*QUAKED spawnfunc_info_player_team3 (1 0 0) (-16 -16 -24) (16 16 24)
414 CTF Starting point for a player in
415 team three (Magenta).
419 viewing angle when spawning
421 void spawnfunc_info_player_team3()
423 self.team = COLOR_TEAM3; // purple
424 spawnfunc_info_player_deathmatch();
428 /*QUAKED spawnfunc_info_player_team4 (1 0 0) (-16 -16 -24) (16 16 24)
429 CTF Starting point for a player in
434 viewing angle when spawning
436 void spawnfunc_info_player_team4()
438 self.team = COLOR_TEAM4; // yellow
439 spawnfunc_info_player_deathmatch();
445 /*QUAKED spawnfunc_item_flag_team1 (0 0.5 0.8) (-48 -48 -37) (48 48 37)
446 CTF flag for team one (Red).
447 Multiple are allowed.
451 Angle the flag will point
454 model to use, note this needs red and blue as skins 0 and 1
455 (default models/ctf/flag.md3)
457 sound played when flag is picked up
458 (default ctf/take.wav)
460 sound played when flag is returned by a teammate
461 (default ctf/return.wav)
463 sound played when flag is captured
464 (default ctf/redcapture.wav)
466 sound played when flag is lost in the field and respawns itself
467 (default ctf/respawn.wav)
470 void spawnfunc_item_flag_team1()
478 //if(!cvar("teamplay"))
479 // cvar_set("teamplay", "3");
481 // link flag into ctf_worldflaglist
482 self.ctf_worldflagnext = ctf_worldflaglist;
483 ctf_worldflaglist = self;
485 self.classname = "item_flag_team";
486 self.team = COLOR_TEAM1; // color 4 team (red)
487 self.items = IT_KEY2; // gold key (redish enough)
488 self.netname = "^1RED^7 flag";
489 self.target = "###item###";
491 if(self.spawnflags & 1)
494 self.model = "models/ctf/flag_red.md3";
496 self.noise = "ctf/take.wav";
498 self.noise1 = "ctf/return.wav";
500 self.noise2 = "ctf/redcapture.wav"; // blue team scores by capturing the red flag
502 self.noise3 = "ctf/respawn.wav";
503 precache_model (self.model);
504 setmodel (self, self.model); // precision set below
505 precache_sound (self.noise);
506 precache_sound (self.noise1);
507 precache_sound (self.noise2);
508 precache_sound (self.noise3);
509 setsize(self, '-16 -16 -37', '16 16 37');
510 setorigin(self, self.origin + '0 0 37');
511 self.nextthink = time + 0.2; // start after doors etc
512 self.think = place_flag;
516 //if(!self.glow_size)
517 // self.glow_size = 50;
519 self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
523 waypoint_spawnforitem(self);
525 WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 37', self, sprite);
528 /*QUAKED spawnfunc_item_flag_team2 (0 0.5 0.8) (-48 -48 -24) (48 48 64)
529 CTF flag for team two (Blue).
530 Multiple are allowed.
534 Angle the flag will point
537 model to use, note this needs red and blue as skins 0 and 1
538 (default models/ctf/flag.md3)
540 sound played when flag is picked up
541 (default ctf/take.wav)
543 sound played when flag is returned by a teammate
544 (default ctf/return.wav)
546 sound played when flag is captured
547 (default ctf/bluecapture.wav)
549 sound played when flag is lost in the field and respawns itself
550 (default ctf/respawn.wav)
553 void spawnfunc_item_flag_team2()
560 //if(!cvar("teamplay"))
561 // cvar_set("teamplay", "3");
563 // link flag into ctf_worldflaglist
564 self.ctf_worldflagnext = ctf_worldflaglist;
565 ctf_worldflaglist = self;
567 self.classname = "item_flag_team";
568 self.team = COLOR_TEAM2; // color 13 team (blue)
569 self.items = IT_KEY1; // silver key (bluish enough)
570 self.netname = "^4BLUE^7 flag";
571 self.target = "###item###";
573 if(self.spawnflags & 1)
576 self.model = "models/ctf/flag_blue.md3";
578 self.noise = "ctf/take.wav";
580 self.noise1 = "ctf/return.wav";
582 self.noise2 = "ctf/bluecapture.wav"; // red team scores by capturing the blue flag
584 self.noise3 = "ctf/respawn.wav";
585 precache_model (self.model);
586 setmodel (self, self.model); // precision set below
587 precache_sound (self.noise);
588 precache_sound (self.noise1);
589 precache_sound (self.noise2);
590 precache_sound (self.noise3);
591 setsize(self, '-16 -16 -37', '16 16 37');
592 setorigin(self, self.origin + '0 0 37');
593 self.nextthink = time + 0.2; // start after doors etc
594 self.think = place_flag;
598 //if(!self.glow_size)
599 // self.glow_size = 50;
601 self.effects = self.effects | EF_FULLBRIGHT | EF_LOWPRECISION;
605 waypoint_spawnforitem(self);
607 WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 37', self, sprite);
611 /*QUAKED spawnfunc_ctf_team (0 .5 .8) (-16 -16 -24) (16 16 32)
612 Team declaration for CTF gameplay, this allows you to decide what team
613 names and control point models are used in your map.
615 Note: If you use spawnfunc_ctf_team entities you must define at least 2! However, unlike
616 domination, you don't need to make a blank one too.
620 Name of the team (for example Red, Blue, Green, Yellow, Life, Death, Offense, Defense, etc)
622 Scoreboard color of the team (for example 4 is red and 13 is blue)
626 void spawnfunc_ctf_team()
633 self.classname = "ctf_team";
634 self.team = self.cnt + 1;
637 // code from here on is just to support maps that don't have control point and team entities
638 void ctf_spawnteam (string teamname, float teamcolor)
640 local entity oldself;
643 self.classname = "ctf_team";
644 self.netname = teamname;
645 self.cnt = teamcolor;
647 spawnfunc_ctf_team();
652 // spawn some default teams if the map is not set up for ctf
653 void ctf_spawnteams()
657 numteams = 2;//cvar("g_ctf_default_teams");
659 ctf_spawnteam("Red", COLOR_TEAM1 - 1);
660 ctf_spawnteam("Blue", COLOR_TEAM2 - 1);
663 void ctf_delayedinit()
665 self.think = SUB_Remove;
666 self.nextthink = time;
667 // if no teams are found, spawn defaults
668 if (find(world, classname, "ctf_team") == world)
671 float sp_score, sp_caps;
672 sp_score = sp_caps = SFL_SORT_PRIO_SECONDARY;
674 sp_score = SFL_SORT_PRIO_PRIMARY;
676 sp_caps = SFL_SORT_PRIO_PRIMARY;
678 CheckAllowedTeams(world);
679 ScoreInfo_Init(2 + (c3>=0)); // NOTE this assumes that the rogue team is team 3
680 ScoreInfo_SetLabel_TeamScore (ST_SCORE, "score", sp_score);
681 ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", sp_caps);
682 ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "kills", 0);
683 ScoreInfo_SetLabel_PlayerScore(SP_DEATHS, "deaths", SFL_LOWER_IS_BETTER);
684 ScoreInfo_SetLabel_PlayerScore(SP_SUICIDES, "suicides", SFL_LOWER_IS_BETTER);
685 ScoreInfo_SetLabel_PlayerScore(SP_SCORE, "score", sp_score);
686 ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", sp_caps);
687 ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns", 0);
688 ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills", 0);
689 ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups", 0);
697 e.think = ctf_delayedinit;
698 e.nextthink = time + 0.1;
699 flagcaptimerecord = stof(db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time")));
702 void ctf_setstatus2(entity flag, float shift)
704 if (flag.cnt == FLAG_CARRY)
705 if (flag.owner == self)
706 self.items |= shift * 3;
708 self.items |= shift * 1;
709 else if (flag.cnt == FLAG_DROPPED)
710 self.items |= shift * 2;
719 self.items = self.items - (self.items & IT_RED_FLAG_TAKEN);
720 self.items = self.items - (self.items & IT_RED_FLAG_LOST);
721 self.items = self.items - (self.items & IT_BLUE_FLAG_TAKEN);
722 self.items = self.items - (self.items & IT_BLUE_FLAG_LOST);
726 float redflags, blueflags;
731 for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE)
733 if(flag.team == COLOR_TEAM1)
735 else if(flag.team == COLOR_TEAM2)
739 // blinking magic: if there is more than one flag, show one of these in a clever way
741 redflags = mod(floor(time * redflags * 0.75), redflags);
743 blueflags = mod(floor(time * blueflags * 0.75), blueflags);
745 for (flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext) if(flag.cnt != FLAG_BASE)
747 if(flag.team == COLOR_TEAM1)
749 if(--redflags == -1) // happens exactly once (redflags is in 0..count-1, and will --'ed count times)
750 ctf_setstatus2(flag, IT_RED_FLAG_TAKEN);
752 else if(flag.team == COLOR_TEAM2)
754 if(--blueflags == -1) // happens exactly once
755 ctf_setstatus2(flag, IT_BLUE_FLAG_TAKEN);
761 entity(float cteam) ctf_team_has_commander =
764 if(cteam != COLOR_TEAM1 || cteam != COLOR_TEAM2)
767 FOR_EACH_REALPLAYER(pl) {
768 if(pl.team == cteam && pl.iscommander) {
775 void(entity e, float st) ctf_setstate =
781 void(float cteam) ctf_new_commander =
786 FOR_EACH_REALPLAYER(pl) {
787 if(pl.team == cteam) {
788 if(pl.iscommander) { // don't reassign if alreay there
791 if(plmax == world || plmax.frags < pl.frags) <<<<<<<<<<<<<<<<< BROKEN in new scoring system
796 bprint(strcat(ColoredTeamName(cteam), " Team has no Commander!\n"));
800 plmax.iscommander = TRUE;
801 ctf_setstate(plmax, 3);
802 sprint(plmax, "^3You're the commander now!\n");
803 centerprint(plmax, "^3You're the commander now!\n");
806 void() ctf_clientconnect =
808 self.iscommander = FALSE;
810 if(!self.team || self.classname != "player") {
811 ctf_setstate(self, -1);
813 ctf_setstate(self, 0);
815 self.team_saved = self.team;
817 if(self.team != 0 && self.classname == "player" && !ctf_team_has_commander(self.team)) {
818 ctf_new_commander(self.team);
822 void() ctf_playerchanged =
824 if(!self.team || self.classname != "player") {
825 ctf_setstate(self, -1);
826 } else if(self.ctf_state < 0 && self.classname == "player") {
827 ctf_setstate(self, 0);
830 if(self.iscommander &&
831 (self.classname != "player" || self.team != self.team_saved)
834 self.iscommander = FALSE;
835 if(self.classname == "player")
836 ctf_setstate(self, 0);
838 ctf_setstate(self, -1);
839 ctf_new_commander(self.team_saved);
842 self.team_saved = self.team;
844 ctf_new_commander(self.team);
847 void() ctf_clientdisconnect =
851 ctf_new_commander(self.team);
855 entity GetPlayer(string);
856 float() ctf_clientcommand =
859 if(argv(0) == "order") {
861 sprint(self, "This command is not supported in this gamemode.\n");
864 if(!self.iscommander) {
865 sprint(self, "^1You are not the commander!\n");
869 sprint(self, "Usage: order #player status - (playernumber as in status)\n");
872 e = GetPlayer(argv(1));
874 sprint(self, "Invalid player.\nUsage: order #player status - (playernumber as in status)\n");
877 if(e.team != self.team) {
878 sprint(self, "^3You can only give orders to your own team!\n");
881 if(argv(2) == "attack") {
882 sprint(self, strcat("Ordering ", e.netname, " to attack!\n"));
883 sprint(e, "^1Attack!\n");
884 centerprint(e, "^7You've been ordered to^9\n^1Attack!\n");
886 } else if(argv(2) == "defend") {
887 sprint(self, strcat("Ordering ", e.netname, " to defend!\n"));
888 sprint(e, "^Defend!\n");
889 centerprint(e, "^7You've been ordered to^9\n^2Defend!\n");
892 sprint(self, "^7Invalid command, use ^3attack^7, or ^3defend^7.\n");