Jump to content
SubSpace Forum Network

Dark Nexus

Member
  • Posts

    85
  • Joined

  • Last visited

Everything posted by Dark Nexus

  1. what kind of a freak are you?! some peoples kids....
  2. I used to know how to program, before the whole floppy drive "accident", but that is another story.....or something bad.....real bad.....
  3. ooohhhh, because the switch has to have a constant
  4. maybe i am not clear on what you need. But the switch would work, with '1'. But if you needed to do arithmatic with the numbers, then i guess what explody thingy said
  5. switch (c->final (or whatever variable you stored it as)) { case 1: { sendPrivate(p, "You selected 1"); break; } case 2: { sendPrivate(p, "You selected 2"); break; } }
  6. yes but isn't p->losses like your total losses, ex: 200 wins and 400 losses ?
  7. 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
×
×
  • Create New...