How to attach text to player
#1

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



Uploaded with ImageShack.us

[rep]
Reply
#2

Nice snoobeit u have there!
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)