09.11.2013, 20:13
I made only the distance part, the rest was copy-paste of what you did. You use %s which is for strings and the arguments are killerid and playerid which are integers..
You'll also need to check if the killer is valid.
That should work:
You'll also need to check if the killer is valid.
That should work:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
new Float:x, Float:y, Float:z, Float:fDistance, szMessage[90], szName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(killerid, x, y, z);
GetPlayerName(killerid, szMessage, MAX_PLAYER_NAME);
GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
format(szMessage, sizeof(szMessage), "%s has killed %s from the distance of %0.2f", szMessage, szName, fDistance);
SendClientMessage(playerid, 0xA9C4E4FF, szMessage);
// I assume you wanted a message to all?
//SendClientMessageToAll(0xA9C4E4FF, szMessage);
}
return 1;
}