to make the "kills-in-a-row = score to add", you need just 1 more variable per player:
pawn Код:
new Kills[MAX_PLAYERS];// your already existing XP-variable, should get saved...
new KillsInARow[MAX_PLAYERS];// this variable needs to get increased at each kill, and set to 0 @ death.
imagine you kill me the first time after logging in:
pawn Код:
KillsInARow[you]++; //its 1 now, since you got 1 kill after logging in. this 1 point for (1 yet) kill gets added to:
Kills[you]+=KillsInARow[you]; //adding that "temprary kill counter" to your real score
so you got 1 score. going further:
pawn Код:
KillsInARow[you]++; //its 2 now. 1+2=
Kills[you]+=KillsInARow[you];// 3 score
so w/o dying, youll earn 1+2+3+4+5+6+7+8+9+10=55 score. not too much, but not too less.
if you die, dont forget to
pawn Код:
KillsInARow[you]=0; //you died? start from beginning.
...if you dont increase the KillsInARow counter before adding it to the "final" score, youll earn 0 score for the first kill, and if you wonder "how much score a player gets when klilling 100 players w/o dying?", heres the solution:
pawn Код:
1+2+3+4+5+6+7+8+9+10 = 55
same as
(first + last) * (amount of numbers / 2)
equals
(1 + 10) * (10 / 2)
=
(11) * (5)
=
55
do that with 100 kills = (1+100)*(100/2) = 101*50 = 5050 score earned. well deserved i guess ^^