SA-MP Forums Archive
little help ? - 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: little help ? (/showthread.php?tid=208046)



little help ? - [CrC]reinixx - 07.01.2011

Can someone send me an example for attaching 3DTextLabel to NPC ??


Re: little help ? - HyperZ - 07.01.2011

use it as FS.
On top of ur script:
pawn Код:
new Text3D:npc3DTextLabel[MAX_PLAYERS];
Onplayerspawn:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!IsPlayerNPC(playerid)) return 1; // We only deal with NPC players in this script
   
    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"mynpc",true)) //put here your NPC name.
    {
        npc3DTextLabel[playerid] = Create3DTextLabel("bla bla bla",0x33FF33AA, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(npc3DTextLabel[playerid],playerid,0.0, 0.0, 0.7);
    }
    return 1;
}



Re: little help ? - Joe Staff - 07.01.2011

Don't place your Text3D: variable in OnPlayerSpawn, you're creating 500 new 3d Texts every time an NPC spawns.


Re: little help ? - HyperZ - 07.01.2011

Quote:
Originally Posted by SilentHuntR
Посмотреть сообщение
Don't place your Text3D: variable in OnPlayerSpawn, you're creating 500 new 3d Texts every time an NPC spawns.
Oops o yeah right. Edited.


Re: little help ? - [CrC]reinixx - 07.01.2011

thank you


Re: little help ? - HyperZ - 07.01.2011

Quote:
Originally Posted by [CrC]reinixx
Посмотреть сообщение
thank you
No Problem.