NPC Problem
#1

I have got a problem... I have got two recorded NPCs npcmodes -> recording, two compiled files in npcmodes, and this script:

Код:
#include <a_samp>

new Line_1_Vehicle;
new Line_2_Vehicle;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("Bots - succesfully loaded!");
     ConnectNPC("Line_1","Line_1");
    ConmectNPC("Line_2","Line_2");
    Line_1_Vehicle = AddStaticVehicle(431, 0.0, 0.0, 5.0, 0.0, 6, 666, 5000);
    Line_2_Vehicle = AddStaticVehicle(431, 0.0, 0.0, 5.0, 0.0, 6, 666, 5000);
    return 1;
)

#else

main()
{
    print("Bots - succesfully unloaded!");
}

#endif

public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid))
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "Line_1", true))
    {
      PutPlayerInVehicle(playerid, Line_1_Vehicle, 0);
      return 1;
    }
    if(!strcmp(npcname, "Line_2", true))
    {
      PutPlayerInVehicle(playerid, Line_2_Vehicle, 0);
      return 1;
    }
    return 1;
  }
  return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    return 1;
}
My NPCs can't connect. It's added to filterscripts in server.cfg, when I open the server, they don't connect (no message). Help?
Reply
#2

Try using, OnPlayerConnect, because they have to connect first before they can request spawn right?
Reply
#3

in server.cfg maxnpc 10?
Reply
#4

I have them in OnFilterScriptInt, before I made bots in Gamemode (worked), now I used the same (some changes to Filterscript), it doesn't work.

And Fire, I have got:

Код:
maxnpc 2
Reply
#5

put 10 and your NPC'S are connected in GAMEMODEINIT?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)