This doc is somewhat obsolete, but the information is useful for you who
wish to edit your own qc logmessages.

-----------------------------------------------------------------------------

     In order to make use of all the features in the Capture That Frank Rank-
ing program there are a couple of changes/addons you have to make to your CTF
progs.dat. The files needed to compile the progs.dat that we are using at our
Black Tower (http://quake.df.lth.se/~quakesrv) is included in this archive
and this text file is just explaining the changes made and WHY they are made.
It is also nice to know what changes that are needed, making it possible for
admins to implement the features they are interested in without having to trust
my code ;). Make sure you understand how the CTF loging is made before you try
to make any modifications. It is very important that the tabulations are at the
right places. Thus EDITing in dos is very bad. 
     We use 3WAVE CTF 4.1 without the custom support at The Tower and the 
ranking program will work best with that version. These are the changes needed 
to be done:

NOTE! Everything below is for POQ (Plain Old Quake), since QWCTF totally
lacks logmessages, it would be quite a lot to document here.
If you still want to look how it's done, every added line has a //Conar at
the end. I recommend that you modify our QWCTF source if you want to
use CTFrank with QW. Basically, the only things you have to modify is
the MOTD and the mapqueue.

-------------------------------------------------------------------------------
NOTE! All row numbers are in our .qc files, which are included, and is only
accurate in the CTF4.1 qc files. If you are interested in using CTFrank with
CTF3.5 and you can't figure out how to make these changes to your .qc-files
you can download CTFrank 0.995 which includes files for CTF 3.5. 
	Feel free to compare these .qc-files with your own. Or steal them :-). 
Don't forget to change the motd then.


ADMIN.QC:
Add at row 183 in void() CheckAdminCmd:
     if (self.team == TEAM_COLOR1 + 1)                                  //Conar
        LogMsg(self, "RED");                                            //Conar
     else                                                               //Conar                
        LogMsg(self, "BLUE");                                           //Conar
These rows are added for the ranking program to make use of it's advanced
scoring algorithm that is one of the two possible ranking systems. It makes
calculations based on how the teams are composed. If someone who is sysop at
the server changes the team of a player this has to be logged, which is done
by the rows above.

CLIENT.QC
Add at row 1:
     .float join_time;                                                  //Conar
Variable used to save the time when the player joined the level.
Needed to make it possible to log time online and to calculate a frag/min
ratio.

Add at row 352 in void() execute_changelevel:
     dprint ("LOG:	");                                             //Conar
     dprint ("TIME	");                                             //Conar
     dprint (ftos(time-other.join_time));                               //Conar
     dprint ("	");                                                	//Conar
     dprint (other.netname);                                            //Conar
     dprint ("\n");                                                     //Conar
     other.join_time = time;                                            //Conar
The level is over and the time the player has been playing this level should 
be logged.

Add at row 1406 in void() ClientConnect:
        self.join_time = time;                                          //Conar
Save what the time is at the time the player logs on.

Add at row 1464 in void() ClientDisconnect:
     dprint ("LOG:	");                                             //Conar
     dprint ("TIME:	");                                             //Conar
     dprint (ftos(time-self.join_time));                                //Conar
     dprint ("	");                                                	//Conar
     dprint (self.netname);                                             //Conar
     dprint ("\n");                                                     //Conar
The Player disconnected from the server. Log the time he was online.

TEAMPLAY.QC:
Change the entire (row 347) float(float t) TeamGetShirt to this:
float(float t) TeamGetShirt =
{
//Conar : nu jaklar :-)
        return t - 1;
        if (t == TEAM_COLOR1) {
                team1shirt = team1shirt + 1;
                if (team1shirt > 14)
                        team1shirt = 0;
                if (team1shirt == TEAM_COLOR2)
                        team1shirt = team1shirt + 1;
                return team1shirt;
        } else { // color2
                team2shirt = team2shirt + 1;
                if (team2shirt > 14)
                        team2shirt = 0;
                if (team2shirt == TEAM_COLOR1)
                        team2shirt = team2shirt + 1;
                return team2shirt;
        }
        return t - 1;
};

Add at row 435 in void() TeamCheckTeam:
     if (self.team == TEAM_COLOR1 + 1)                                  //Conar
        LogMsg(self, "RED");                                            //Conar
     else                                                               //Conar                
        LogMsg(self, "BLUE");                                           //Conar

Add at row 539 in void() TeamCheckLock:
     if (self.team == TEAM_COLOR1 + 1)                                  //Conar
        LogMsg(self, "RED");                                            //Conar
     else                                                               //Conar                
        LogMsg(self, "BLUE");                                           //Conar
Make use of the advanced team calculations and logg what team a player is
on.

Add at row 956 in void() TeamCaptureFlagTouch:
     local entity tmp;                                                  //Conar
     local float TEAM1, TEAM2;                            		//Conar

Add at row 1060 in void() TeamCaptureFlagTouch:
     TEAM1 = 0;                                                         //Conar
     TEAM2 = 0;                                                         //Conar

     tmp = find (world, classname, "player");                           //Conar

     while(tmp)                                                         //Conar
     {                                                                  //Conar
        if (tmp != self) {                                              //Conar
           if( (TEAM_COLOR1 >= 0) && (tmp.team == (TEAM_COLOR1 +1)) )   //Conar
               TEAM1 = TEAM1 + 1;                                       //Conar
           if( (TEAM_COLOR2 >= 0) && (tmp.team == (TEAM_COLOR2 +1)) )   //Conar
               TEAM2 = TEAM2 + 1;                                       //Conar
        }                                                               //Conar
        tmp = find(tmp, classname, "player");                           //Conar
     }                                                                  //Conar

     if ((TEAM1 != 0) && (TEAM2 != 0)) {                                //Conar

Add at row 1114 in void() TeamCaptureFlagTouch:
     } else  {                                                          //Conar
       bprint(other.netname);                                           //Conar
       bprint(", are you trying to cheat?\n");                          //Conar
     }                                                                  //Conar
This huge part is added just to make sure that all players don't play in the
same team with no one else in the other team, capturing alot of flags. 
This would screw up the ranking.

-------------------------------------------------------------------------------
//Tobias Srensen aka Lord Conar, tsn@df.lth.se

