How to attach text to player
#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


Messages In This Thread
How to attach text to player - by smokeweed - 27.01.2012, 18:00
Re: How to attach text to player - by FireCat - 27.01.2012, 18:10
Re: How to attach text to player - by liquid13 - 27.01.2012, 18:14
Re: How to attach text to player - by henry jiggy - 27.01.2012, 18:28

Forum Jump:


Users browsing this thread: 1 Guest(s)