Hide Player Name
#1

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
Reply
#2

check this
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer
Reply
#3

https://sampwiki.blast.hk/wiki/GetPlayerPos -use this with some floats to get the target's position.
https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer -this is to hide the player name.
And from what i understood you need to play around a bit with IsPlayerInRangeOfPoint
Reply
#4

pawn Код:
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;
}
pawn Код:
public OnGameModeInit()
{
    ShowPlayerMarkers(0);
        return 1;
}
Reply
#5

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)