07.10.2012, 01:34
You already got a kill variable, dont you? I will call it gPlayerKills.
That were my toughts, add what you want
pawn Код:
// OnPlayerDeath
if(killerid != INVALID_PLAYER_ID) {
new
expGain,
kills = ++gPlayerKills[killerid]
;
if(kills == 1) { // for the first kill
expGain += 10; // 10 - 20 exp
}
if((kills % 5) == 0) { // for every fifth kill he gets bonus exp
expGain += kills; // 5 kills = 5 - 10 exp | 10 kills = 10 - 20 exp | 15 kills = 15 - 30 exp
}
if(reason < 16) {
expGain += 10; // melee kill = 10 - 20 exp
} else {
expGain += 5; // range kill = 5 - 10 exp
}
expGain += random(expGain); // random that he could get the double exp
}