|
Quake Style - Quake 3 Tutorials Newbie Tutorials - Cloaking Cheat How to add a new cheat (just like "god") which lets you be invisible |
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
// 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!!!