Problem with NPCS
#1

Hello, i got a problem with my NPCS. I have made two npcs. They connect & spawn correctly.

This is what happends:
SCREENSHOT:


Well as you see, They get the same skin id. And they get a 3Dtextlabel twice.
And i tried alot to fix this. But i cant seem to fix it.
Here is my OnPlayerSpawn code. where the NPC has there skin id & stuff.

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(strcmp(npcname, "butler1", true))
        {
            SetPlayerSkin(playerid, 172);
            SetPlayerColor(playerid,COLOR_WHITE);
            label[playerid] = Create3DTextLabel("Butler - Press F to speak to me",COLOR_RED,30.0,40.0,50.0,40.0,0);
            Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
        }
        if(strcmp(npcname, "Weapon", true))
        {
            SetPlayerSkin(playerid, 171);
            SetPlayerColor(playerid,COLOR_WHITE);
            label2[playerid] = Create3DTextLabel("Weapon Dealer - Press F to speak to me",COLOR_RED,30.0,40.0,50.0,40.0,0);
            Attach3DTextLabelToPlayer(label2[playerid], playerid, 0.0, 0.0, 0.7);
        }
        return 1;
    }
    SetPlayerPos(playerid, 1477.6693,-1565.2162,23.5469);
    return 1;
}
How can i fix this?

Thanks, Alex
Reply


Messages In This Thread
Problem with NPCS - by BizzyD - 10.04.2011, 13:14
Re: Problem with NPCS - by Admigo - 10.04.2011, 13:18
Re: Problem with NPCS - by BizzyD - 10.04.2011, 13:20
Re: Problem with NPCS - by Admigo - 10.04.2011, 13:54
Re: Problem with NPCS - by BizzyD - 10.04.2011, 14:00
Re: Problem with NPCS - by bigcomfycouch - 10.04.2011, 14:03
Re: Problem with NPCS - by Admigo - 10.04.2011, 14:04
Re: Problem with NPCS - by BizzyD - 10.04.2011, 14:08
Re: Problem with NPCS - by BizzyD - 10.04.2011, 14:52
Re: Problem with NPCS - by Admigo - 10.04.2011, 15:17

Forum Jump:


Users browsing this thread: 1 Guest(s)