SA-MP Forums Archive
Need help with Create3DTextLabel - 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: Need help with Create3DTextLabel (/showthread.php?tid=318314)



Need help with Create3DTextLabel - Shidony - 14.02.2012

Hi everybody !

I need some help to create a new system on my Gamemode.

I explain it:

I want that a 3DTextLabel tells the name of the player (i Can do it easily) but the problem is that i want the 3DTextLabel to change only for one player when that player is on Admin Duty.

Example: My name is Jayceon McKinley, im a the Admin, next to me, there is Ryder Blind, so i see above his head: Ryder Blind(6) (6 is the ID of the player) i want to see:

Ryder Blind (6)
Health: his health
Armor: his armor

But only me and other admins on duty can see it, is it possible to do ? I have done this like that:

pawn Код:
new Float:Health;
    GetPlayerHealth(playerid,Health);
    new Float:Armor;
    GetPlayerArmour(playerid,Armor);
    new sStr[256];
    if(aDuty[playerid])
    {
        format(sStr, sizeof(sStr), "Admin Text: %s (%d)", NameUnder(playerid),playerid);
        Nom[playerid] = Create3DTextLabel(sStr, COLOR_WHITE, 30.0, 40.0, 10.0, 10.0, 0);
        Update3DTextLabelText(Nom[playerid],COLOR_WHITE, sStr);
    }
    else
    {
        format(sStr, sizeof(sStr), "%s (%d)", NameUnder(playerid),playerid);
        Nom[playerid] = Create3DTextLabel(sStr, COLOR_WHITE, 30.0, 40.0, 10.0, 10.0, 0);
        Update3DTextLabelText(Nom[playerid],COLOR_WHITE, sStr);
    }
I put Admin Text to test, i'll change it to Health: %0.0f\n Armor: %0.0f when the system will work


AW: Need help with Create3DTextLabel - Drebin - 14.02.2012

You can show 3D labels only to all players, not only for one.


Re : Need help with Create3DTextLabel - Shidony - 14.02.2012

Okey thx


Re: Need help with Create3DTextLabel - Universal - 14.02.2012

But you can create a 3D text label for a specific player.

Wiki:CreatePlayer3DTextLabel