20.05.2017, 21:24
You can do most of those thing just under OnPlayerDeath.The only thing you can't know on OnPlayerDeath is the bodypart.
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID)
{
new string[128], weapon[32], killerName[MAX_PLAYER_NAME], playerName[MAX_PLAYER_NAME],
Float:pX, Float:pY, Float:pZ, Float: PfPDistance;
GetPlayerName(killerid, killerName, sizeof(killerName));
GetPlayerName(playerid, playerName, sizeof(playerName));
GetWeaponName(reason, weapon, sizeof(weapon));
GetPlayerPos(playerid, pX, pY, pZ);
PfPDistance = GetPlayerDistanceFromPoint(killerid, pX, pY, pZ);
format(string, sizeof(string), "%s (%i) Killed %s (%i) - %s From %0.2fm Away.", killerName, killerid, playerName, playerid, weapon, PfPDistance);
SendClientMessageToAll(0x9D000096, string);
//
PlayerInfo[killerid][pKills]++;
}
DeadPlayer[playerid] = 0;
SetPlayerColor(playerid, COLOR_DEAD);
PlayerInfo[playerid][pDeaths]++;
TextDrawHideForPlayer(playerid,Clock);
TextDrawHideForPlayer(playerid, DaysOfWeek);
TextDrawHideForPlayer(playerid, FpsAndPing[playerid]);
TextDrawHideForPlayer(playerid, ZoneName[playerid]);
HideTDs(playerid);
return 1;
}