public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); // +1 Score to KillerID
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1); // -1 Score to PlayerID
SendDeathMessage(killerid, playerid, reason); // Death Windows
GivePlayerMoney(playerid, -200); // - 100 to the player get Killed
GivePlayerMoney(killerid, 457); // + 100 to the killer
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason) {
if (killerid != INVALID_PLAYER_ID) {// The killer ID is not an invalid player
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); // +1 score to killer
GivePlayerMoney(killerid, 457); // +475 to killer
}
GivePlayerMoney(playerid, -200);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
SendDeathMessage(killerid, playerid, reason);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason); // Death Windows
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); // +1 Score to KillerID
GivePlayerMoney(killerid, 457); // + 100 to the killer
}
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1); // -1 Score to PlayerID
GivePlayerMoney(playerid, -200); // - 100 to the player get Killed
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); // +1 Score to KillerID
GivePlayerMoney(killerid, 457); // + 100 to the killer
}
SendDeathMessage(killerid, playerid, reason); // Death Windows
GivePlayerMoney(playerid, -200); // - 100 to the player get Killed
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1); // -1 Score to PlayerID
// } This goes wrong here.
return 1;
}
|
pawn Код:
|
|
Originally Posted by MP2
First of all, you should check if killerid is actually valid.
|
|
Read MP2's post. You should check if the killerid is an INVALID_PLAYER.
|