06.11.2014, 17:43
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(PlayerInfo[playerid][OnDuty] == 1 || PlayerInfo[playerid][God] == 1)
{
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);
}
}
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); PlayerPlaySound(issuerid,1190,0.0,0.0,0.0);
}
return 1;
}
but that headshot show msg admin get headshot but admin not died