3D Label Visible to Certain Players - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 3D Label Visible to Certain Players (
/showthread.php?tid=469993)
3D Label Visible to Certain Players -
DesertFoxNight - 15.10.2013
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.
Re: 3D Label Visible to Certain Players -
Pottus - 15.10.2013
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.
Re: 3D Label Visible to Certain Players -
DesertFoxNight - 15.10.2013
Thank you very much Pottus. I was looking at Create3DTextLabel() instead of looking at CreatePlayer3DTextLabel().