new Text3D:npc3DTextLabel[MAX_PLAYERS];
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;
}
Don't place your Text3D: variable in OnPlayerSpawn, you're creating 500 new 3d Texts every time an NPC spawns.
|