how can I make this code, when an admin is spec on a particular player, appearing admin dmg you give the player that is spec in other players?
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
new targetplayer = Specdmg[playerid] = true;
new Float:x2,Float:y2,Float:z2;
GetPlayerPos(targetplayer,x2,y2,z2);
if(IsPlayerInRangeOfPoint(playerid, 5.0, x2, y2, z2))
{
new stringRC[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
new weaponname[24];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetPlayerName(damagedid, victim, sizeof (victim));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
format(stringRC, sizeof(stringRC), "{F59DDB}DMG: %s did %.0f damage to %s using weapon: %s", attacker, amount, victim, weaponname);
ABroadCast(COLOR_YELLOW,stringRC,1);
}
return 1;
}
loop through every player and check if they're spectating the player who gives / takes damage. If they do, then show them a message.