06.11.2014, 11:32
How to get distance shoot ?
like Hostoxide killed you within 100 meters
like Hostoxide killed you within 100 meters
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart) { new Float:x, Float:y, Float:z, Float:Distance; GetPlayerPos(damagedid, x, y, z); Distance = GetPlayerDistanceFromPoint(playerid, x,y,z); return 1; }
public OnPlayerDeath(playerid, killerid, reason)
{
if (killerid != INVALID_PLAYER_ID)
{
new Float:coords[3];
GetPlayerPos(playerid, coords[0], coords[1], coords[2]);
format(str, sizeof(str), "You've been killed (Distance: %.2f meters).", GetPlayerDistanceFromPoint(killerid, coords[0], coords[1], coords[2]);
SendClientMessage(playerid, -1, str);
}
return 1;
}