31.07.2012, 14:33
Hi i have a problem with OnPlayerDeath. I want wen a player kills a nother player to give him +50hp to the existing hp but it gives +50hp to the killed player. Please help me !
Here is OnPlayerDeath code:
Here is OnPlayerDeath code:
Код:
public OnPlayerDeath(playerid, killerid, reason) { for (new i = 0; i < MAX_PLAYERS; i++) GameTextForPlayer(i, "~g~Killing Spree~n~~y~+15.000$+50HP~y~", 5000, 3); new Float:Health; GetPlayerHealth(playerid, Health); SetPlayerHealth(playerid, Health+50); GivePlayerMoney(killerid,15000);//<-------added this SendDeathMessage(killerid, playerid, reason); TextDrawHideForPlayer(playerid,HealthBar[playerid]); GameTextForPlayer(playerid, "~r~You Die", 5000, 2); neon(playerid); nrg(playerid); if( DMZone[killerid] >= 1) { TextDrawHideForPlayer(playerid,HealthBar[playerid]); SetPlayerScore(playerid,GetPlayerScore(playerid)+1); SetPlayerScore(killerid,GetPlayerScore(killerid)-0); GameTextForPlayer(playerid, "~r~You Die", 5000, 2); PlayCrimeReportForPlayer(playerid, killerid, 3); kills[killerid]++; } if( DMZone[killerid] == 0) { TextDrawHideForPlayer(playerid,HealthBar[playerid]); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); SetPlayerScore(playerid,GetPlayerScore(playerid)-0); GameTextForPlayer(playerid, "~r~You Die", 5000, 2); PlayCrimeReportForPlayer(playerid, killerid, 3); } return 1; }