Onplayertakedamage
#3

Quote:
Originally Posted by M4D
Посмотреть сообщение
Try This:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(PlayerInfo[playerid][OnDuty] == 1 || PlayerInfo[playerid][God] == 1)
    {
        PlayerInfo[playerid][Aweaps] = 1;
        SetPlayerHealth(playerid, 1000.0);
        GameTextForPlayer(issuerid,"~r~Don't attack admins on-duty!", 3000, 3);
        new Float:Health, Float:x, Float:y, Float:z;
        GetPlayerHealth(issuerid,Health);
        GetPlayerPos(issuerid,x,y,z);
        SetPlayerPos(issuerid,x,y,z+6);
        PlayerPlaySound(issuerid,1190,0.0,0.0,0.0);
    }
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        new string[128];
        new Float:distance = GetDistanceBetweenPlayers(playerid, issuerid, UNIT_METERS); // LINE 43
        format(string, sizeof(string), "~y~%s ~b~headshotted ~y~%s ~w~from ~r~%f meters.",GetName(issuerid),GetName(playerid), distance);
        bMessage(string);
        GameTextForPlayer(issuerid,"~r~Headshot!!", 3000, 3);
        GameTextForPlayer(playerid,"~r~Headshot!!", 3000, 3);
        SetPlayerHealth(playerid, 0.0);
    }

    return 1;
}
Same problem
Reply


Messages In This Thread
Onplayertakedamage - by Hostoxide - 06.11.2014, 17:43
Re: Onplayertakedamage - by M4D - 06.11.2014, 18:24
Re: Onplayertakedamage - by Hostoxide - 06.11.2014, 18:40
Re: Onplayertakedamage - by Pottus - 06.11.2014, 19:13

Forum Jump:


Users browsing this thread: 1 Guest(s)