SA-MP Forums Archive
How to attach text to player - 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: How to attach text to player (/showthread.php?tid=313855)



How to attach text to player - smokeweed - 27.01.2012

How to attach the class text to a player like this picture?



Uploaded with ImageShack.us

[rep]


Re: How to attach text to player - FireCat - 27.01.2012

Nice snoobeit u have there!


Re: How to attach text to player - liquid13 - 27.01.2012

pawn Код:
Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ)
pawn Код:
public OnPlayerConnect(playerid)
{
 new Text3D:label = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
 Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
 return 1;
}
Source & More Information : https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer

If you use gTeam ...
pawn Код:
static gTeam[MAX_PLAYERS];
#define FIRST_TEAM 1
#define SECOND_TEAM 2
forward SetPlayerTeamFromClass(playerid,classid);
pawn Код:
public SetPlayerTeamFromClass(playerid,classid)
{
    if(classid == 0 || classid == 1) {
        gTeam[playerid] = FIRST_TEAM;
    } else if(classid == 2 || classid == 3) {
        gTeam[playerid] = SECOND_TEAM;
    }
}
pawn Код:
public OnPlayerSpawn(playerid)
{
 if(gTeam[playerid] = FIRST_TEAM)
 {  
  new Text3D:label = Create3DTextLabel("Team 1", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  return 1;
 }
 if(gTeam[playerid] = SECOND_TEAM)
 {  
  new Text3D:label = Create3DTextLabel("Team 2", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  return 1;
 }
}
Not Tested


Re: How to attach text to player - henry jiggy - 27.01.2012

You know, you could cut the site off... and use your fckin panic button before taking a screenshot lol