OnplayerDeath Error
#7

I'll point out few parts that do no check if killer is connected/valid player:

pawn Код:
if (PlayerPaintballing[playerid] != 0)
    {
        foreach(Player, x)
        {
            if ((PlayerPaintballing[playerid] != 0 && PlayerPaintballing[killerid] != 0) && PlayerPaintballing[x])
            {
                SendDeathMessageToPlayer(x, killerid, playerid, reason);
            }
        }
        new string[500];


        new pinfo[128];
        KillP[killerid]++;
        DeathP[playerid]++;

        format(string, sizeof(string), "You have killed %s. You now have %d kills.", GetName(playerid), KillP[killerid]);
        SendClientMessage(killerid, COLOR_GENANNOUNCE, string);

        format(string, sizeof(string), "You have been killed by %s.", GetName(killerid));
        SendClientMessage(playerid, COLOR_GENANNOUNCE, string);

        PlayerPaintballScore[killerid] = KillP[killerid];
        if (PlayerPaintballScore[killerid] > PaintballWinnerScore)
        {
            PaintballWinner = killerid;
            PaintballWinnerScore = PlayerPaintballScore[killerid];
            foreach(Player, i)
            {
                if (IsPlayerConnected(i))
                {
                    if (PlayerPaintballing[i] != 0)
                    {
                        format(pinfo, sizeof(pinfo), ""
                            HP11 "[Paintball]: "
                            HP22 "%s is now in lead with %d kills.", GetName(PaintballWinner), PaintballWinnerScore);
                        SCM(i, COLOR_YELLOW, pinfo);
                    }
                }
            }
        }
        return 1;
    }
and
pawn Код:
savePlayerData(killerid);
Quote:
Originally Posted by Sreyas
Посмотреть сообщение
why u assigning killerid to INVALID_PLAYER_ID
It doesn't affect anything but it has no point of use either.
Reply


Messages In This Thread
OnplayerDeath Error - by TheWay - 22.05.2016, 11:52
Re: OnplayerDeath Error - by oMa37 - 22.05.2016, 14:21
Re: OnplayerDeath Error - by Konstantinos - 22.05.2016, 14:24
Re: OnplayerDeath Error - by TheWay - 22.05.2016, 14:44
Re: OnplayerDeath Error - by SyS - 22.05.2016, 14:47
Re: OnplayerDeath Error - by TheWay - 22.05.2016, 14:58
Re: OnplayerDeath Error - by Konstantinos - 22.05.2016, 15:40

Forum Jump:


Users browsing this thread: 4 Guest(s)