-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathctf.qc
49 lines (46 loc) · 1.83 KB
/
ctf.qc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//==========================================
// Functions for CTF Support
//==========================================
void () TeamFortress_CTF_FlagInfo = {
local entity te;
te = Finditem(CTF_FLAG1);
if (te.goal_state == TFGS_ACTIVE) {
if (self == te.owner) {
sprint(self, PRINT_HIGH, "You have the enemy flag. ");
} else {
sprint(self, PRINT_HIGH, te.owner.netname, " has");
if (self.team_no == 1)
sprint(self, PRINT_HIGH, " your flag. ");
else
sprint(self, PRINT_HIGH, " the enemy flag. ");
}
} else if (te.origin != te.oldorigin) {
if (self.team_no == 1)
sprint(self, PRINT_HIGH, "Your flag is lying about. ");
else
sprint(self, PRINT_HIGH, "The enemy flag is lying about. ");
} else if (self.team_no == 1)
sprint(self, PRINT_HIGH, "Your flag is in your base. ");
else
sprint(self, PRINT_HIGH, "The enemy flag is in their base. ");
te = Finditem(CTF_FLAG2);
if (te.goal_state == TFGS_ACTIVE) {
if (self == te.owner) {
sprint(self, PRINT_HIGH, "You have the enemy flag.\n");
} else {
sprint(self, PRINT_HIGH, te.owner.netname, " has");
if (self.team_no == 2)
sprint(self, PRINT_HIGH, " your flag.\n");
else
sprint(self, PRINT_HIGH, " the enemy flag.\n");
}
} else if (te.origin != te.oldorigin) {
if (self.team_no == 2)
sprint(self, PRINT_HIGH, "Your flag is lying about.\n");
else
sprint(self, PRINT_HIGH, "The enemy flag is lying about.\n");
} else if (self.team_no == 2)
sprint(self, PRINT_HIGH, "Your flag is in your base.\n");
else
sprint(self, PRINT_HIGH, "The enemy flag is in their base.\n");
};