Need Help with NPC
#1

I used the tutorial about NPCs by kc, yes... But here's the problem...

I recorded one with name "Line_1" (with /vrecord). I did and compiled the file to npcmodes, then I added to my gamemode these stuff:

Код:
new Line1;
Then

Код:
public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    return 1;
}
Later...

Код:
public OnPlayerSpawn(playerid)
{
  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    if(!strcmp(npcname, "Line_1", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, Line1, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
      }
//My stuff here :)
return 1;
}
Then...

Код:
public OnGameModeInit()
{

    ConnectNPC("Line_1","Line_1");
    Line1 = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, -1, -1, 999999999);
That's all. My problem is here, the NPC doesn't appear. It only says in samp-server.exe:

Код:
Incoming connection: 127.0.0.1:1748
The number of slots doesn't change from 125 to 124, when I come in-game, it doesn't appear.

Help?
Reply
#2

Fixed. I had number "maxnpcs": 0. My fail.
Reply
#3

rofl xD thats shit xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)