01.04.2013, 00:16
Hi, I have this on sv but it resets the full money of the player who gets killed.
What I want is to give the killer +2 score and $100 and to the victim -1 score and $-100. Can anyone help me with this . Thank you.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerChatBubble(playerid, "XC", 0xFFFF0000, 100.0, 3000);
new playercash;
if(killerid == INVALID_PLAYER_ID) {
ResetPlayerMoney(playerid);
} else {
SendDeathMessage(killerid,playerid,reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
playercash = GetPlayerMoney(playerid);
if (playercash > 0) {
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
else
{
}
}
return 1;
}