14.10.2010, 08:38
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;
if(killerid == INVALID_PLAYER_ID) {
return SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
}
if(gTeam[killerid] != gTeam[playerid]) { // The following code will only continue if the killerid and playerids teams do not match.
switch(KillingSpree[killerid]) {
case 3..9: {
new
pName[MAX_PLAYER_NAME], string[64]; // You do NOT need 256 cells!
GetPlayerName(killerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is on a killing spree (x%d)", pName, KillingSpree[killerid]);
SendClientMessageToAll(RED, string);
}
case 10: {
new
pName[MAX_PLAYER_NAME], string[100]; // You do NOT need 256 cells!
GetPlayerName(killerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is on a massive killing spree (x10)", pName);
SendClientMessageToAll(RED, string);
format(string, sizeof(string), "%s has won $1 million dollars for fulfilling a massive x10 killing spree!", pName);
SendClientMessageToAll(RED, string);
SendDeathMessage(killerid, playerid, reason);
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 1000000);
}
}
}
else { // And if they do....
SendClientMessage(killerid, RED, "Do NOT kill your team mates");
GivePlayerMoney(killerid, -5000);
SetPlayerHealth(killerid, 0);
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
}
return 1;
}
