multiplayer_gamerules.cpp
; this is the only file we will be editing. Find line 631 (Ctrl+G) where it should say:
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
pKiller->frags += IPointsForKill( peKiller, pVictim );
Now change the line pKiller->frags += IPointsForKill( peKiller, pVictim );
to the following code:
pKiller->frags += pVictim->pev->frags;
pVictim->pev->frags = 0;
This will add the number of frags pVictim
has to pKiller
's frag count. It then sets pVictim
's frag count to 0
. Now if you kill someone, you will receive their frags. However, the game can never actually start, as no-one has any frags to steal. There are two ways to sort this out, either start by giving everyone some frags, meaning that the game can still get stuck, or give pKiller
the normal amount of frags if they kill someone with no frags:
if (pVictim->pev->frags == 0)
{
pKiller->frags += IPointsForKill( peKiller, pVictim );
pVictim->pev->frags = 0;
}
else
{
pKiller->frags += pVictim->pev->frags;
pVictim->pev->frags = 0;
}
However, if pVictim
has killed himself, and has a negative amount of frags, then pKiller
's frags would go down. To stop this we do our final change in code:
if (pVictim->pev->frags > 0)
{
pKiller->frags += pVictim->pev->frags;
pVictim->pev->frags = 0;
}
else
{
pKiller->frags += IPointsForKill( peKiller, pVictim );
pVictim->pev->frags = 0;
}
If pVictim
's frags are above 0, then it will add their frags, if not then it adds the normal amount of frags.You must log in to post a comment. You can login or register a new account.