HP Problem
#1

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:


Код:
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;
}
Reply
#2

pawn Код:
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(killerid, Health);
    SetPlayerHealth(killerid, 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;
}
try this
Reply
#3

Ty XStormiest(+rep) problem is solved but i have a question : how to do wen the player after killing and haves 100hp to give him +50 armor like the hp ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)