SA-MP Forums Archive
Npc Problem - 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: Npc Problem (/showthread.php?tid=291485)



Npc Problem - Salsa - 20.10.2011

Npc not Connecting to My server
I add this Link on my gm
Код:
ConnectNPC("SampEverNpcTest", "SampEverNpcTest");
And I Add These Link On OnPlayerSpawn

Код:
if(IsPlayerNPC(playerid))
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "SampEverNpcTest", true))
        SetPlayerSkin(playerid, 271);
  		new Text3D:PTD1 = Create3DTextLabel("[SampEverNpcTest]",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
   	    Attach3DTextLabelToPlayer(PTD1, playerid, 0.0, 0.0, 0.5);
        {
            PutPlayerInVehicle(playerid, BotVehicle, 0);
        }
    }
Help Me


Re: Npc Problem - [HiC]TheKiller - 20.10.2011

Make sure that you return 1 on any script that tends to kick people. Also, make sure that in your server.cfg, that max_npc's is more than 0.


Re: Npc Problem - Salsa - 20.10.2011

Ok Its working

and its for only 1 npc

Quote:

{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "SampEverNpcTest", true))
SetPlayerSkin(playerid, 271);
new Text3D:PTD1 = Create3DTextLabel("[SampEverNpcTest]",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(PTD1, playerid, 0.0, 0.0, 0.5);
{
PutPlayerInVehicle(playerid, BotVehicle, 0);
}
}

how i create text on 2nd npc and how i give a name to 2npc


Re: Npc Problem - Salsa - 20.10.2011

Sorry for Double Post
But I really Need Help
Ok Its working

and its for only 1 npc

Quote:

{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "SampEverNpcTest", true))
SetPlayerSkin(playerid, 271);
new Text3D:PTD1 = Create3DTextLabel("[SampEverNpcTest]",COLOR_GREEN,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(PTD1, playerid, 0.0, 0.0, 0.5);
{
PutPlayerInVehicle(playerid, BotVehicle, 0);
}
}