3D Label Visible to Certain Players
#1

Is it possible to have a 3D label only visible to a group of players, but have it hidden to the rest of the players not in the group?

For example, I have two teams: Team A and Team B. Players in Team A do not know who are the players in Team B because everyone will have a 3D label with the text of "Team A" for players in Team A. However, players in Team B do know the who their teammates are because their teammates will have a 3D label that reads "Team B." This 3D label should only be visible to players in Team B and not to players in Team A.
Reply
#2

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel

you'd have to do something like....

new AttachLabels[MAX_PLAYERS][MAX_PLAYERS];

pawn Код:
foreach(new i : Player)
{
    foreach(new j : Player)
    {
        if(i == j) continue;
        if(Team[i] == Team[j])
        {
            // Create player label and attach to specified player
            AttachLabels[i][j] = CreatePlayer3DTextLabel(i, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, j, attachedvehicle, testLOS);
        }
    }
}
There is still more to do such as creating labels when a player joins or destroying when a player disconnects this part would be for when a new player joins the server it will create all the 3D Labels for that that player.
Reply
#3

Thank you very much Pottus. I was looking at Create3DTextLabel() instead of looking at CreatePlayer3DTextLabel().
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)