Welcome to FigPops.com

Back to the Starter Page
Quake 3 Tutorials
Deus Ex Tutorials
Quake 1 Expansion Project
Newbies Guide to Modmaking
FigPops.com Forums
Email Monkey

This is how to add a Frag Multiplier to a normal DM game, completely server side.

in g_local.h
around line 241 you'll find

struct gclient_s {

now scroll down a coupla of lines until you find

int invulnerabilityTime;

char *areabits;

just below that add

//pigpen frag multiplier
int fragmult;
int fragtime;
//end pigpen

now save and open g_client.c

find void ClientSpawn around line 1015

scroll down until you find

client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_GAUNTLET );
client->ps.ammo[WP_GAUNTLET] = -1;
client->ps.ammo[WP_GRAPPLING_HOOK] = -1;

then add

//pigpen frag multiplier
client->fragmult = 1;
//end pigpen

now save and open g_active.c

find void ClientTimerActions around line 383

scroll down until you see

// count down health when over max
if ( ent->health > client->ps.stats[STAT_MAX_HEALTH] ) {
and add
//pigpen frag multiplier
if (client->fragtime >= 60)
{ client->fragtime = 0;
client->fragmult = client->fragmult +1;
trap_SendServerCommand( client - level.clients, "cp \"Your Frag Multiplier just went up by one.\n\"" );
{ client->fragtime = client->fragtime + 1;
//pigpen end


// count down armor when over max
if ( client->ps.stats[STAT_ARMOR] > client->ps.stats[STAT_MAX_HEALTH] ) {

so it will end up looking as above

now save and open g_combat.c

find void AddScore around line 32
and where it says

ent->client->ps.persistant[PERS_SCORE] += score;

make it

ent->client->ps.persistant[PERS_SCORE] += score*ent->client->fragmult; //pig frag mult

now save and compile, tada, every 60 seconds the player is alive he/she gets +1 to their frag multiplier, meaning a person who stays alive for 5 minutes will get 5 frags for every 1 kill.

Texture of the day
Submit your own Texture of the Day

FigPops, the Frozen Monkey and site design by FigPops.com.