OnPlayerDeath
#1

Something weird with this. It should say the message according to the every 5 kills. But it will say it 5 times before it switches to the other one. Also since this the kills on the kill list are showing except for the Suicide picture. The Code:


pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  KILLINGSPREE[killerid]++;
    if(KILLINGSPREE[killerid] >= 5)
    {
        new string [128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid, pName, sizeof(pName));
        format(string, sizeof(string), "%s is on a killing spree!", pName);
        GameTextForAll(string, 5000, 1);
        PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
        SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
    }
    if(KILLINGSPREE[killerid] >= 10)
    {
        new string [128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid, pName, sizeof(pName));
        format(string, sizeof(string), "~b~%s is dominating!", pName);
        GameTextForAll(string, 5000, 1);
        PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
        SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
    }
    if(KILLINGSPREE[killerid] >= 15)
    {
        new string [128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid, pName, sizeof(pName));
        format(string, sizeof(string), "~g~%s is dominating!", pName);
        GameTextForAll(string, 5000, 1);
        PlayerPlaySound(killerid, 1062, -1370.2362, -256.3250, 14.1440);
        SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
    }
    if(KILLINGSPREE[killerid] >= 20)
    {
        new string [128];
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(killerid, pName, sizeof(pName));
        format(string, sizeof(string), "~g~%s is ~u~God like!~u~", pName);
        GameTextForAll(string, 5000, 1);
        PlayerPlaySound(killerid, 1097, -1370.2362, -256.3250, 14.1440);
        SetTimerEx("MUSICTIMER",8000,1, "i", killerid);
    }
    if(PlayerIsInDM[playerid] == true)
    {
      SendClientMessage(playerid, COLOR_LIGHTBLUE, "You haved died in a deathmatch and your random spawning has been disabled.");
      SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /random to re enable it");
        RANDOM[playerid] = false;
    }
    if(PlayerIsInDM[playerid] == false)
    {
        RANDOM[playerid] = true;
    }
    if(killerid != INVALID_PLAYER_ID)
    {
      GivePlayerMoney(killerid, GetPlayerMoney(killerid) + 50);
        SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    }
    KILLINGSPREE[playerid] = 0;
    SetPlayerWantedLevel(playerid, 0);
    SendDeathMessage(killerid, playerid, reason);
  return 1;
}
EDIT: Yet in my test server it worked fine with me and 1 other person testing.
Reply


Messages In This Thread
OnPlayerDeath - by BP13 - 08.11.2009, 16:02
Re: OnPlayerDeath - by member - 08.11.2009, 16:07
Re: OnPlayerDeath - by BP13 - 09.11.2009, 03:38
Re: OnPlayerDeath - by StrickenKid - 09.11.2009, 04:12

Forum Jump:


Users browsing this thread: 1 Guest(s)