Found a big bug.
Let's say, kill[killerid]=9;
pawn Код:
if(kill[killerid] >= 2) {
SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get tripple kill!");
}
if(kill[killerid] >= 3) {
SendClientMessage(killerid,COLOR_GREEN,"You killed three players you got $10,000, 1 cookie and 20+ health!");
new string[50];
PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
format(string, sizeof(string), "~w~tripple~r~kill");
GameTextForPlayer(killerid, string, 3000, 6);
SetPlayerHealth(killerid,Health+20);
cookies[playerid] += 1;
GivePlayerMoney(killerid, 10000);
}
if(kill[killerid] >= 5) {
SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get mega kill!");
}
if(kill[killerid] >= 6) {
SendClientMessage(killerid,COLOR_GREEN,"Mega kill, you got 30,000, 2 cookies and 20+ health!");
new string[50];
PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
format(string, sizeof(string), "~w~mega~r~kill");
GameTextForPlayer(killerid, string, 3000, 6);
SetPlayerHealth(killerid,Health+20);
cookies[playerid] += 2;
GivePlayerMoney(killerid, 30000);
}
if(kill[killerid] == 8) {
SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get ultra kill!");
}
if(kill[killerid] == 9) {
SendClientMessage(killerid,COLOR_GREEN,"Ultra kill, you got 50,000, 3 cookies and 50+ health!");
PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
SetPlayerHealth(killerid,Health+50);
cookies[playerid] += 3;
new string[50];
format(string, sizeof(string), "~w~ultra~r~kill");
GameTextForPlayer(killerid, string, 3000, 6);
GivePlayerMoney(killerid, 50000);
}
kill[killerid] >= 2 ? True.
kill[killerid] >= 3 ? Also true.
....
So you will get money for all true statements, not to mention the flood about 1 more kill bla bla bla.
You should switch to Switch function.
pawn Код:
switch(kill[killerid])
{
case 2:
{
SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get tripple kill!");
}
case 3:
{
SendClientMessage(killerid,COLOR_GREEN,"You killed three players you got $10,000, 1 cookie and 20+ health!");
new string[50];
PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
format(string, sizeof(string), "~w~tripple~r~kill");
GameTextForPlayer(killerid, string, 3000, 6);
SetPlayerHealth(killerid,Health+20);
cookies[playerid] += 1;
GivePlayerMoney(killerid, 10000);
}
case 5:
{
SendClientMessage(killerid,COLOR_GREEN,"One more kill and you'll get mega kill!");
}
case 6:
{
SendClientMessage(killerid,COLOR_GREEN,"Mega kill, you got 30,000, 2 cookies and 20+ health!");
new string[50];
PlayerPlaySound(killerid, 1185, 258.4893,-41.4008,1002.0234);
format(string, sizeof(string), "~w~mega~r~kill");
GameTextForPlayer(killerid, string, 3000, 6);
SetPlayerHealth(killerid,Health+20);
cookies[playerid] += 2;
GivePlayerMoney(killerid, 30000);
}
..........
}
Another bug:
GetPlayerHealth(playerid,Health); GetPlayerArmour(playerid,Armour);
Your finding the playerid health, and setting it to the killerid.