[HELP]Individual Deaths Screen Code Bug
#4

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;
}
Reply


Messages In This Thread
[HELP]Individual Deaths Screen Code Bug - by <Weponz> - 14.10.2010, 07:25
Re: [HELP]Individual Deaths Screen Code Bug - by legodude - 14.10.2010, 08:09
Re: [HELP]Individual Deaths Screen Code Bug - by <Weponz> - 14.10.2010, 08:26
Re: [HELP]Individual Deaths Screen Code Bug - by Calgon - 14.10.2010, 08:38
Re: [HELP]Individual Deaths Screen Code Bug - by <Weponz> - 14.10.2010, 09:00
Re: [HELP]Individual Deaths Screen Code Bug - by Retardedwolf - 14.10.2010, 09:00
Re: [HELP]Individual Deaths Screen Code Bug - by <Weponz> - 14.10.2010, 09:04
Re: [HELP]Individual Deaths Screen Code Bug - by Lenny the Cup - 14.10.2010, 09:28
Re: [HELP]Individual Deaths Screen Code Bug - by Retardedwolf - 14.10.2010, 09:29

Forum Jump:


Users browsing this thread: 1 Guest(s)