SA-MP Forums Archive
Another utterly non-random question (Nametags-related) - 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: Another utterly non-random question (Nametags-related) (/showthread.php?tid=610420)



Another utterly non-random question (Nametags-related) - Maxandmov - 23.06.2016

Is there any possibility to make a nametag player-styled for actors (health and armor bar are not required)? Is there any other, more beautiful way than calculating 3DTextDraw position above actor's head?
Thanks.


Re: Another utterly non-random question (Nametags-related) - Owen007 - 23.06.2016

yes there is this can help u to make a player name that appers on head in 3d.

Код:
#include <a_samp>
#define NAME_DRAWDISTANCE (5) // The distance of the 3d text nametags to appear.
new Text3D:NameTag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];

public OnGameModeInit()
{
    SetNameTagDrawDistance(0.0);
    ShowNameTags(false);
	return 1;
}

public OnPlayerConnect(playerid)
{
	playerName = p_name( playerid );
	NameTag[playerid] = Create3DTextLabel( playerName, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
    Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel( NameTag[playerid] );
	return 1;
}

stock p_name( playerid )
{
	new p_namev[MAX_PLAYER_NAME];
	GetPlayerName(playerid, p_namev, MAX_PLAYER_NAME);
	return p_namev;
}



Re: Another utterly non-random question (Nametags-related) - Maxandmov - 23.06.2016

But I need to create a nametag for an actor.
Besides, I was hoping I won't have to use 3DTextDraw. I can do calculations via 3DTextDraw myself.

So... Is posssible or is not possible?


Re: Another utterly non-random question (Nametags-related) - Owen007 - 23.06.2016

Bro i dont think its possible but maybe wait for others to reply and good luck.


Re: Another utterly non-random question (Nametags-related) - Maxandmov - 23.06.2016

Quote:
Originally Posted by Owen007
Посмотреть сообщение
Bro i dont think its possible but maybe wait for others to reply and good luck.
Thanks! You too!


Re: Another utterly non-random question (Nametags-related) - DRIFT_HUNTER - 23.06.2016

Its not possible, actors are not players. The only way at the moment is with 3D Labels.
My suggestion is to turn off player name tags, and replace them with 3D Labels for players. Then you can do the same for actors.


Re: Another utterly non-random question (Nametags-related) - Maxandmov - 24.06.2016

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Its not possible, actors are not players. The only way at the moment is with 3D Labels.
My suggestion is to turn off player name tags, and replace them with 3D Labels for players. Then you can do the same for actors.
Ok thanks for the tip. I'll stick to labels then.