PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
// Headshot System
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(playerid, "~r~HEADSHOT", 3000, 3);
GameTextForPlayer(issuerid, "~g~HEADSHOT", 3000, 3);
new Float:x, Float:y, Float:z, Float:fDistance, hsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(issuerid, x, y, z);
GetPlayerName(issuerid, KName, MAX_PLAYER_NAME);
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
format(hsMessage, sizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f", KName, PName, fDistance);
SendClientMessageToAll(0xFCFC18AA, hsMessage);