Attach3DTextLabel - [Admin] -
NoDi522 - 29.03.2015
PHP код:
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new Text3D:ALabel = Create3DTextLabel(""COLOR_CRVENA"[Admin]",-1,x,y,z,30,0,0);
if(PlayerInfo[playerid][pAdministrator])
{
Attach3DTextLabelToPlayer(ALabel,playerid,x,y,z+1);
}
I also tried Attach3DTextLabelToPlayer(ALabel,playerid,0.0,0.0, 0.7); and nothing doesn't show. Fix?
Re: Attach3DTextLabel - [Admin] -
CalvinC - 29.03.2015
Try using Incognito's streamer and dynamic labels instead.
Re: Attach3DTextLabel - [Admin] -
NoDi522 - 29.03.2015
Oh. This?
PHP код:
native Text3D:CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
native DestroyDynamic3DTextLabel(Text3D:id);
native IsValidDynamic3DTextLabel(Text3D:id);
native GetDynamic3DTextLabelText(Text3D:id, text[], maxtext = sizeof text);
native UpdateDynamic3DTextLabelText(Text3D:id, color, const text[]);
Re: Attach3DTextLabel - [Admin] -
CalvinC - 29.03.2015
Yes, so it would be:
pawn Код:
CreateDynamic3DTextLabel(""COLOR_CRVENA"[Admin]", -1, x, y, z, 30, playerid);
But you should also declare it as a global array, so you can later destroy it when the administrator goes off-duty or disconnects.
Re: Attach3DTextLabel - [Admin] -
NoDi522 - 29.03.2015
Not in good relationship with arrays
Re: Attach3DTextLabel - [Admin] -
Luca12 - 29.03.2015
he mean like this on the top of the gamemode
new Text3D:ALabel[MAX_PLAYERS];
then in aon cmd
ALabel[playerid] = CreateDynamic3DTextLabel(...
and where you turn off duty put like this
DestroyDynamic3DTextLabel[ALabel[playerid]);
Re: Attach3DTextLabel - [Admin] -
CalvinC - 29.03.2015
In the top of your gamemode (globally):
pawn Код:
new Text3D:ALabel[MAX_PLAYERS];
And to declare it as your TextLabel:
pawn Код:
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
ALabel[playerid] = CreateDynamic3DTextLabel(""COLOR_CRVENA"[Admin]", -1, x, y, z, 30, playerid);
}
I usually use like SERVER_SLOTS and define that to my servers slots (100, 200 etc by #define SERVER_SLOTS 200), but a lot of people likes using MAX_PLAYERS(500) in their arrays for some reason, as above post, so you can use whatever you want.
You can read more about arrays here:
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
https://sampforum.blast.hk/showthread.php?tid=318212
Re: Attach3DTextLabel - [Admin] -
Luca12 - 29.03.2015
CalvinC doens't he must define label as 3D in the new like I put
new Text3D:ALabel[MAX_PLAYERS];
Re: Attach3DTextLabel - [Admin] -
CalvinC - 29.03.2015
I edited my post because i forgot that, and the CreateDynamic3DTextLabel.
Re: Attach3DTextLabel - [Admin] -
NoDi522 - 29.03.2015
I will take a look on this tutorials,thank you. And also thank you for an example

- However it works but first i've done : "z+3" and nothing changed,the text is just at the top of the head. Than i tried "z+10" and the same thing as z+3. Any ideas?