Attach3DTextLabel - [Admin]
#1

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?
Reply
#2

Try using Incognito's streamer and dynamic labels instead.
Reply
#3

Oh. This?

PHP код:
native Text3D:CreateDynamic3DTextLabel(const text[], colorFloat:xFloat:yFloat:zFloat:drawdistanceattachedplayer INVALID_PLAYER_IDattachedvehicle INVALID_VEHICLE_IDtestlos 0worldid = -1interiorid = -1playerid = -1Float:streamdistance 100.0);
native DestroyDynamic3DTextLabel(Text3D:id);
native IsValidDynamic3DTextLabel(Text3D:id);
native GetDynamic3DTextLabelText(Text3D:idtext[], maxtext sizeof text);
native UpdateDynamic3DTextLabelText(Text3D:idcolor, const text[]); 
Reply
#4

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.
Reply
#5

Not in good relationship with arrays
Reply
#6

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]);
Reply
#7

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
Reply
#8

CalvinC doens't he must define label as 3D in the new like I put

new Text3D:ALabel[MAX_PLAYERS];
Reply
#9

I edited my post because i forgot that, and the CreateDynamic3DTextLabel.
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)