Placing Text Above Someone - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Placing Text Above Someone (
/showthread.php?tid=158124)
Placing Text Above Someone -
TKZ227 - 08.07.2010
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?
Re: Placing Text Above Someone -
CAR - 08.07.2010
pawn Код:
public OnGameModeInit( )
{
ShowNameTags(0);
}
Re: Placing Text Above Someone -
Hiddos - 08.07.2010
Addition to car:
Combine Create3DTextLabel with players, and update the text label every x minutes.
https://sampwiki.blast.hk/wiki/Create3DTextLabel
Re: Placing Text Above Someone -
[XST]O_x - 08.07.2010
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.
Re: Placing Text Above Someone -
Hiddos - 08.07.2010
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.