in player.h under external dependencies you can add "int deaths" to the player struct struct Player
{
Uint16 ident;
Operator_Level access;
Player *turret;
Uint16 flagCount;
Uint32 lastPositionUpdate;
bool acceptsAudio;
>>>>> int deaths; <<<<<
char name[20];
char squad[20];
BYTE banner[96];
BYTE ship;
BYTE d;
Uint16 bounty;
Uint16 energy;
Uint16 timer;
Uint16 S2CLag;
Vector tile, pos, work, vel;
bool stealth, cloak, xradar, awarp, ufo, flash, safety;
bool shields, supers;
BYTE burst, repel, thor, brick, decoy, rocket, portal;
Uint16 team;
Score score;
bool koth;
void setBanner(char *bbanner);
void clone(Player *p);
void move(Sint32 x, Sint32 y, Sint32 vx, Sint32 vy);
void move(Sint32 x, Sint32 y);
void move(Sint32 time);
Player(Uint16 iident, char *nname, char *ssquad, Uint32 fflagPoints, Uint32 kkillPoints, Uint16 tteam, Uint16 wwins, Uint16 llosses, BYTE sship, bool aacceptsAudio, Uint16 fflagCount);
}; to initialize the variable to 0, put this in under EVENT_PlayerEntering case EVENT_PlayerEntering:
{
Player *p = (Player*)event.p[0];
p->deaths = 0;
break;
} now in spawn.cpp goto "EVENT_PlayerDeath" and insert this code under it; case EVENT_PlayerDeath:
{
Player *p = (Player*)event.p[0],
*k = (Player*)event.p[1];
Uint16 bounty = (Uint16)event.p[2];
p->deaths = p->deaths + 1; /* increases players death count by 1 */
if (p->deaths == 3)
{
p->deaths = 0; /* resets players deaths so when they are unspecced they won't be specced automatically*/
sendPrivate(p, "*spec");
sendPrivate(p, "You have been killed 3 times, you will now be placed in spectator mode");
sendPublic("*arena "+(String)p->name+ " has been eliminated");
}
break;
} Hope this helps, and if there is a easier way, feel free to correct me