npc doesnt join server
#1

heres the code basicly i start the server and the npc doesnt even attempt to connect WHY?


this is at the top
Код:
#include <a_samp>
#include <streamer>

new MyFirstNPCVehicle; //Global variable!
this is on gamemodegui

Код:
	MyFirstNPCVehicle = CreateVehicle(541, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
	ConnectNPC("MyFirstNPC","mynpc");
this is on playerspawn

Код:
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, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
and the npc file and YES THE RECORD FILES ARE THEIR


Код:
#define RECORDING "mynpc" //This is the filename of your recording without the extension.
#define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

#include <a_npc>

main(){}
public OnRecordingPlaybackEnd()
{
	StartRecordingPlayback(RECORDING_TYPE, RECORDING);
}
#if RECORDING_TYPE == 1
  public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
  public OnNPCExitVehicle() StopRecordingPlayback();
#else
  public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
#endif
and max npc is set to : 1


and it doesnt even attempt to join why thanks
Reply
#2

sorry to ask but any1 comeon please?
Reply
#3

wow the samp forums realy suck thanks for the help guys your the BEST>NOT
Reply
#4

Check the line maxnpc in server.cfg.
Change it to 1 or 2 or how many NPCs you wish to use.
Reply
#5

i have its set to :1 because i have 1 npc
Reply
#6

.................................................. ..............
Reply
#7

You don't need main( ) { } in the miniscript. Idk what could be the problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)