NPC doesn't connect to server? WTF?
#1

Hi there,

I'm having some problems with NPCs. I've followed kc's tutorial but my bots won't connect to my server!

Here take a look at some of my script.

npcmodes script:
Код:
#include <a_npc>
new NPCVAR;
main()
{
	print("NPC: ''airport-cityhall'' - Script Initializing.");
}
public OnNPCModeInit()
{
	print("NPC: ''airport-cityhall'' - Script has been loaded.");
	return 1;
}
public OnNPCModeExit()
{
	print("NPC: ''airport-cityhall'' - Script has been unloaded.");
	return 1;
}
public OnNPCSpawn()
{
  print("NPC: ''airport-cityhall'' - Spawned.");
  SendCommand("/ooc Hello everyone! I'm a bot! Have fun :P");
  return 1;
}
public OnRecordingPlaybackEnd()
{
	if(NPCVAR==0)
	{
	  StopRecordingPlayback();
		StartRecordingPlayback(1, "airport2cityhall");
		NPCVAR++;
		return 1;
	}
	if(NPCVAR==1)
	{
	  StopRecordingPlayback();
		StartRecordingPlayback(1,"cityhall2airport");
		NPCVAR--;
		return 1;
	}
	return 1;
}
public OnNPCEnterVehicle(vehicleid, seatid)
{
	StopRecordingPlayback();
	StartRecordingPlayback(1, "cityhall2airport");
	return 1;
}
parts involving NPCs in my Gamemode:
Код:
// this is under #include a_samp
new npc1car;
#define npc1name "Paul_Ference"
Код:
// this part is in OnGameModeInit
ConnectNPC(npc1name,"airport-cityhall");
npc1car=CreateVehicleEx(420,-2196.8511,965.4650,79.7805,269.1402,6,1,1800,npc1name,0); // Taxi
// function of my custom vehicle system. last two parameters are: ownername and price
Код:
// part of OnPlayerSpawn
  if(IsPlayerNPC(playerid))
  {
    new npcname[24];
    GetPlayerName(playerid, npcname, 24); 
    if(!strcmp(npcname, npc1name, true))
    {
      SetPlayerPos(playerid,-2196.8511,965.4650,79.7805);
      PutPlayerInVehicle(playerid, npc1car, 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
So this is the code involving NPCs I wrote. When I open my server, it freezes when ConnectNPC is called and it unfreezes few seconds later, and the GM finishes loading, without any NPC connecting.

Please, help mehhhh!!!

TANHKS!! lol
Reply


Messages In This Thread
NPC doesn't connect to server? WTF? - by x-cutter - 12.09.2009, 22:56
Re: NPC doesn't connect to server? WTF? - by V1ceC1ty - 13.09.2009, 01:46
Re: NPC doesn't connect to server? WTF? - by x-cutter - 13.09.2009, 02:22
Re: NPC doesn't connect to server? WTF? - by V1ceC1ty - 13.09.2009, 02:54
Re: NPC doesn't connect to server? WTF? - by Nibblet - 13.09.2009, 09:43
Re: NPC doesn't connect to server? WTF? - by x-cutter - 13.09.2009, 11:44
Re: NPC doesn't connect to server? WTF? - by x-cutter - 13.09.2009, 12:07
Re: NPC doesn't connect to server? WTF? - by V1ceC1ty - 13.09.2009, 12:36
Re: NPC doesn't connect to server? WTF? - by x-cutter - 13.09.2009, 13:40

Forum Jump:


Users browsing this thread: 8 Guest(s)