2001-07-23 20:52:47 +00:00
|
|
|
#include "defs.qh"
|
2001-07-17 05:58:10 +00:00
|
|
|
/*
|
|
|
|
TeamFortress 1.38 - 11/12/96
|
|
|
|
|
|
|
|
TeamFortress Software
|
|
|
|
Functions for CTF Support
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Functions in this file
|
|
|
|
void() TeamFortress_CTF_FlagInfo;
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
// Display the whereabouts of the flags
|
|
|
|
void() TeamFortress_CTF_FlagInfo =
|
|
|
|
{
|
|
|
|
local entity te;
|
|
|
|
|
|
|
|
// Flag 1
|
2001-07-23 20:52:47 +00:00
|
|
|
te = Finditem(CTF_FLAG1);
|
|
|
|
if (te.goal_state == TFGS_ACTIVE)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if (self == te.owner)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "You have the enemy flag. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, te.owner.netname);
|
|
|
|
sprint(self, PRINT_HIGH, " has");
|
2001-07-17 05:58:10 +00:00
|
|
|
if (self.team_no == 1)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, " your flag. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, " the enemy flag. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (te.origin != te.oldorigin)
|
|
|
|
{
|
|
|
|
if (self.team_no == 1)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Your flag is lying about. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "The enemy flag is lying about. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (self.team_no == 1)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Your flag is in your base. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "The enemy flag is in their base. ");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Flag 2
|
2001-07-23 20:52:47 +00:00
|
|
|
te = Finditem(CTF_FLAG2);
|
|
|
|
if (te.goal_state == TFGS_ACTIVE)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
if (self == te.owner)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "You have the enemy flag.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, te.owner.netname);
|
|
|
|
sprint(self, PRINT_HIGH, " has");
|
2001-07-17 05:58:10 +00:00
|
|
|
if (self.team_no == 2)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, " your flag.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, " the enemy flag.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (te.origin != te.oldorigin)
|
|
|
|
{
|
|
|
|
if (self.team_no == 2)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Your flag is lying about.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "The enemy flag is lying about.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (self.team_no == 2)
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "Your flag is in your base.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(self, PRINT_HIGH, "The enemy flag is in their base.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
};
|