public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][pDeaths] = PlayerInfo[playerid][pDeaths] + 1;
PlayerInfo[killerid][pScore] = PlayerInfo[killerid][pScore] + 1; /*the function will stop/end
here. Because killerid is not involved in playerids suicide/death.*/
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1; //line wont be reached.
PlayerInfo[killerid][pGameKills] = PlayerInfo[killerid][pGameKills] + 1; //line wont be reached.
PlayerInfo[playerid][pScore] = PlayerInfo[playerid][pScore] - 1; //Etc.
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][pDeaths] = PlayerInfo[playerid][pDeaths] + 1;
PlayerInfo[playerid][pScore] = PlayerInfo[playerid][pScore] - 1;
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
PlayerInfo[killerid][pScore] = PlayerInfo[killerid][pScore] + 1; /*the function will stop/end
here. Because killerid is not involved in playerids suicide/death.*/
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1; //line wont be reached.
PlayerInfo[killerid][pGameKills] = PlayerInfo[killerid][pGameKills] + 1; //line wont be reached.
return 1; //Etc.
}
PlayerInfo[playerid][pDeaths] = PlayerInfo[playerid][pDeaths] =+ 1;
PlayerInfo[killerid][pScore] = PlayerInfo[killerid][pScore] =+ 1; /*the function will stop/end
here. Because killerid is not involved in playerids suicide/death.*/
PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] =+ 1; //line wont be reached.
PlayerInfo[killerid][pGameKills] = PlayerInfo[killerid][pGameKills] =+ 1; //line wont be reached.
PlayerInfo[playerid][pScore] = PlayerInfo[playerid][pScore] =- 1; //Etc.
This post is just to warn the helpers that are NOT AWARE of this bug, so they can assist others.
|
if (killerid != INVALID_PLAYER_ID)
if (IsPlayerConnected(killerid))
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[playerid][pDeaths]++;
PlayerInfo[playerid][pScore]--;
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
if (killerid != INVALID_PLAYER_ID)
PlayerInfo[killerid][pScore]++;
PlayerInfo[killerid][pKills]++;
PlayerInfo[killerid][pGameKills]++;
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
return 1;
}