npc doesnt join server - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: npc doesnt join server (
/showthread.php?tid=237359)
npc doesnt join server -
hadzx - 09.03.2011
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
Re: npc doesnt join server -
hadzx - 09.03.2011
sorry to ask but any1 comeon please

?
Re: npc doesnt join server -
hadzx - 09.03.2011
wow the samp forums realy suck thanks for the help guys your the BEST>NOT
Re: npc doesnt join server -
Johnson_boy - 09.03.2011
Check the line maxnpc in server.cfg.
Change it to 1 or 2 or how many NPCs you wish to use.
Re: npc doesnt join server -
hadzx - 09.03.2011
i have its set to :1 because i have 1 npc
Re: npc doesnt join server -
hadzx - 09.03.2011
.................................................. ..............
Re: npc doesnt join server -
Mean - 09.03.2011
You don't need main( ) { } in the miniscript. Idk what could be the problem.