04.09.2012, 09:58
How can i hide a players name when i put the target on him with a gun, in TAB to apear but if he is near i want to not apear his name
stock IsPlayerAimingAtPlayer(playerid, targetid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if (IsPlayerAimingAt(playerid, x, y, z-0.75, 0.25)) return true;
if (IsPlayerAimingAt(playerid, x, y, z-0.25, 0.25)) return true;
if (IsPlayerAimingAt(playerid, x, y, z+0.25, 0.25)) return true;
if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
return false;
}
public OnGameModeInit()
{
ShowPlayerMarkers(0);
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:X,Float:Y,Float:Z;
for(new i=0;i<MAX_PLAYERS;++i)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,50,X,Y,Z)) ShowPlayerNameTagForPlayer(playerid, i, false);
else ShowPlayerNameTagForPlayer(playerid, i, true);
}
return 1;
}