SA-MP Forums Archive
NPC wont connect - 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 wont connect (/showthread.php?tid=613272)



NPC wont connect - MayaEU - 26.07.2016

Why dont my npc connect to the server?

OnGameModeInit
pawn Код:
print("NPC/John_Wikings has connected");
    ConnectNPC("Train","John_Wikings");
OnPlayerSpawn
pawn Код:
if(IsPlayerNPC(playerid))
    {
        new string[32];
        GetPlayerName(playerid, string, 32);
        if(!strcmp(string, "John_Wikings"))
        {
            SetPlayerSkin(playerid, 264);
            PutPlayerInVehicle(playerid, Train, 0);
            print("NPC/John_Wikings has spawned");
        }
        return 1;
    }



Re: NPC wont connect - justjamie - 26.07.2016

Quote:

OnPlayerConnect
print("NPC/John_Wikings has connected");
ConnectNPC("Train","John_Wikings");

So everytime a player connects, the NPC also has to connect?
I think you wanna add this code to OnGamemodeInit


Re: NPC wont connect - MayaEU - 26.07.2016

I also have it on OnGameModeInit too
just added it to OnPlayerSpawn to see if it worked


Re: NPC wont connect - JustMe.77 - 26.07.2016

What is Max NPC in your server configuration?


Re: NPC wont connect - MayaEU - 26.07.2016

Quote:
Originally Posted by JustMe.77
Посмотреть сообщение
What is Max NPC in your server configuration?
maxnpc 3