07.10.2012, 12:07
Just in the middle...
pawn Код:
stock
gPlayerKills[MAX_PLAYERS]
;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
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
// use here the function to give the player his exp
}
return true;
}