SA-MP Forums Archive
NPC Not even connecting.... - 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 Not even connecting.... (/showthread.php?tid=447709)



NPC Not even connecting.... - KingyKings - 01.07.2013

Hello, i will go through it all now.
I used a tutorial... :P
Quote:

new YourVehicle;

Код:
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, "NPC_TEST", true)) //Checking if the NPC's name is MyFirstNPC
    	{
    	    SendClientMessageToAll(COLOR_BLUE, "I'm connected :)" );
      		PutPlayerInVehicle(playerid, YourVehicle, 0); //Putting the NPC into the vehicle we created for it.
    	}
    	return 1;
  	}
	SetPlayerPos(playerid, -113.6331,2123.1306,19.7735);
	SetPlayerInterior(playerid,0);
	return 1;
}
My recording of the NPC is called "again".
Код:
ConnectNPC("NPC_TEST","again"); // 
YourVehicle = CreateVehicle(431, -248.0467, 2323.6631, 112.6103, 0.0000, -1, -1, 100);
Thats on gamemodeinit ^

This is the "again" filterscript in npcmodes folder.
Код:
#define RECORDING "again" //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
Thats everything i have got. The recording for the NPC is in the recordings folder in npcmodes.

Where am i going wrong because the NPC is not even connecting?


Re: NPC Not even connecting.... - CoaPsyFactor - 01.07.2013

Did you put in server.cfg maxnpc 1+?


Re: NPC Not even connecting.... - KingyKings - 01.07.2013

No i didnt LOL Thankyou it works now <3