Quake Style - Quake 3 Tutorials
Newbie Tutorials - Cloaking Cheat
How to add a new cheat (just like "god") which lets you be invisible

Add this right down at the end of the g_cmds.c file, near around the god mode command:

    else if (Q_stricmp (cmd, cloak) == 0)             //cloak code
    {
        char    *msg;

        if ( !CheatsOk( ent ) ) {
                return;
        }
        ent->flags ^= FL_CLOAK;

        if (!(ent->flags & FL_CLOAK))
        {
                        msg = Cloaking OFF\n;
                        ent->client->ps.powerups[PW_INVIS] = level.time;
        }
        else
        {
                        msg = Cloaking ON\n;
                        ent->client->ps.powerups[PW_INVIS] = level.time + 1000000000;
        }
                trap_SendServerCommand( ent-g_entities, va(print \s\, msg));

    }  //end cloak code

Next, add a flag to g_local.h after FL_NOHUMANS, I did it like this

// gentity->flags
#define FL_GODMODE                      0x00000010
#define FL_NOTARGET                     0x00000020
#define FL_TEAMSLAVE                    0x00000400      // not the first on the team
#define FL_NO_KNOCKBACK                 0x00000800
#define FL_DROPPED_ITEM                 0x00001000
#define FL_NO_BOTS                      0x00002000      // spawn point not for bot use
#define FL_NO_HUMANS                    0x00004000      // spawn point just for bots
#define FL_CLOAK                        0x00010000  // NEW CODE HERE!!!

Well, that should be it, hopefully that will get you up and running with the cloaking command.
Aslong as you have cheats enabled, bind a key to cloak and it'll work (or should, it did for me).

This bit of code doesn't have to be used for cheating, of course!

-- Credits:
   Tutorial by Telekin
   Return to QS Tutorials

-- Important:
   If you do use something from QuakeStyle in your mod, please give us credit.
   Our code is copyrighted, but we give permission to everyone to use it in any way they see fit, as long as we are recognized.