22.05.2016, 15:40
I'll point out few parts that do no check if killer is connected/valid player:
and
It doesn't affect anything but it has no point of use either.
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;
}
pawn Код:
savePlayerData(killerid);