Ok well am intermediate to this mod making i have a vague knowledge of making but kinda learn from other people code,
i know that RTCW is made on a Quake3 engine and most of the code is the same i have come across www.planetquake/code3arena site which gives tuts on making a mod for quake.
Well there are several things that i would like to add into my mod and i was wondering if there is a way of doing some changes to it. if anyone can help with the following would be appricated.
this is so that the player becomes cloaked, for a certain time, or untill its health decreases
In the g_local.h file
#define FL_CLOAK 0x00010000 // health cloaking
in g_cmds.c
/*
=================
Cmd_Cloak_f
=================
*/
void Cmd_Cloak_f( gentity_t *ent ) {
char *msg; // message to player
ent->flags ^= FL_CLOAK;
if (!(ent->flags & FL_CLOAK)) {
msg = "Cloaking OFF
";
ent->client->ps.powerups[PW_INVIS] = level.time;
// Removes the invisible powerup from the player
}
else {
msg = "Cloaking ON
";
ent->client->ps.powerups[PW_INVIS] = level.time + 1000000000;
// Gives the invisible powerup to the player
}
trap_SendServerCommand( ent-g_entities, va("print \"%s\"", msg));
}
and adding in the command to console
else if (Q_stricmp (cmd, "cloak") == 0)
Cmd_Cloak_f( ent );
in the g_active file
if (!(ent->flags & FL_CLOAK)) {
// count down health when over max and not cloaked.
if ( ent->health > client->ps.stats[STAT_MAX_HEALTH] ) {
ent->health--;
}
}
else {
// count down health when cloaked.
ent->health--;
if ( ent->health < 11) {
ent->flags ^= FL_CLOAK;
ent->client->ps.powerups[PW_INVIS] = level.time;
}
}
in the g_combat file
if (self->flags & FL_CLOAK) {
// remove the invisible powerup if the player is cloaked.
self->client->ps.powerups[PW_INVIS] = level.time;
}
I know something has to be changed its probally real simple but all it is doing now is making the name of the player disappear
Thank for reading
and i hope someone can help me out