20.05.2017, 20:54
it fixed but when it kill player the message not showing to all .. dont work i mean
here's onplayerdeath
here's OnplayerTakeDamage
here's onplayerdeath
Quote:
public OnPlayerDeath(playerid, killerid, reason) { DeadPlayer[playerid] = 0; SetPlayerColor(playerid, COLOR_DEAD); PlayerInfo[killerid][pKills]++; PlayerInfo[playerid][pDeaths]++; TextDrawHideForPlayer(playerid,Clock); TextDrawHideForPlayer(playerid, DaysOfWeek); TextDrawHideForPlayer(playerid, FpsAndPing[playerid]); TextDrawHideForPlayer(playerid, ZoneName[playerid]); HideTDs(playerid); return 1; } |
Quote:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { new Floatldhealth; // victim health before taking damage GetPlayerHealth(playerid,oldhealth); // victim health before taking damage new currenthp = oldhealth - amount; // calculating current health after taking damage if(currenthp == 0.0) { new Float:kx, Float:ky, Float:kz, string[156], WeaponName[24], VictimName[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME]; // killer coordinates variables GetPlayerPos(issuerid, kx, ky, kz); // their positions and distance between them new Float: PfPDistance = GetPlayerDistanceFromPoint(playerid, kx, ky, kz); GetPlayerName(playerid, VictimName, sizeof (VictimName)); GetPlayerName(issuerid, KillerName, sizeof (KillerName)); GetWeaponName(weaponid, WeaponName, sizeof (WeaponName)); format(string, sizeof(string), "%s (%i) Killed %s (%i) - %s (%s) From %0.2fm Away.", KillerName, issuerid, VictimName, playerid, WeaponName, bodypart, PfPDistance); SendClientMessageToAll(playerid, 0x9D000096, string); } return 1; } |