02.11.2013, 21:04
Hello, i wanted to ask for a litle code for OnPlayerDeath, when you die you dont lose money but when you are killed by someone he gets for example 1000$ and +1 score, can someone write that to me?
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
{
pScore[killerid]++;
SetPlayerScore(killerid, pScore[killerid]);
pCash[killerid] += 1000;
GivePlayerMoney(killerid, 1000);
}
}
} public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); pInfo[playerid][Deaths]++; GivePlayerCash(playerid, +1000); SetPlayerScore(playerid, GetPlayerScore(playerid) +1);