Placing Text Above Someone
#1

I have seen on another server, where they had 3d text above the player's head that said their name and stuff, instead of nametags. I know I would need to disable nametags and all, but how would I put the text above their head wherever they go?
Reply
#2

pawn Код:
public OnGameModeInit( )
{
    ShowNameTags(0);
}
Reply
#3

Addition to car:

Combine Create3DTextLabel with players, and update the text label every x minutes.

https://sampwiki.blast.hk/wiki/Create3DTextLabel
Reply
#4

Can't you just use GetPlayerName,format,Create3DTextLabel,and Attach3DTextLabelToPlayer under OnPlayerSpawn? I think it's better than updating the text label,please correct me if I'm mistaken.
Reply
#5

True that, but if he for example would like to show kills. Simple textdraws are win though. What I most like about those 3D texts is that you can simply place them anywhere. A must-have for roleplay servers, so you won't see armor/hp ^^.

pawn Код:
public OnPlayerSpawn(playerid)
{
  if(GetPVarInt(playerid,"TD") == 0) {
  new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof pName);
  new TD = Create3DTextLabel(pName,0xff00ffff,0,0,080,0,0);
  Attach3DTextLabelToPlayer(TD,playerid,0,0,2);
  SetPVarInt(playerid,"TD",TD+1);
  }
  return 1;
}
Thingy for TD+1: GetPVarInt returns '0' when that PVar hasn't been set. The first player to spawn would get TD id 0, which is equal to not having created a textdraw.

BTW: Don't forget to destroy them at OnPlayerDisconnect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)