NPC Glitches
#1

Ok i have made my npc pack second...

In this pack is abou 10 npc's wlying walking standing driving etc....

Ok i will start about my problem..

I made FS for npc..

Start it.. npc's joins etc...

i go in the server to look on them ..

But WOW npc respawns each 1 second... ! :

Driving npc : car goes like it was recorded .. but npc witch is inside of it respawns all time in car so it makes npc laging etc...

WTF is hapening

If you dont understand what im typeing please say it
Reply
#2

Oh.. dude.. I read this 3 times and didn't understood you.

pliz skep dos an-imporan diteils!
Reply
#3

I know my eng is realy bad..

I have driving npc. It respawns in car each sec.... its driving it on his way but player(npc in car) respawns all time making that car laging

now u understand or i need to make vid ?
Reply
#4

Just say your NPC is spawning every second, it's something with your NPC script, please show it!
Reply
#5

Код:
///////////////////////////////////////////////////////////////////////////////
////////////////////////-GaGlets-LS-PACK-for-SERVERS-//////////////////////////
///////////////////////////////////////////////////////////////////////////////



#include <a_samp>
#include <a_npc>

new seller;
new police;
new police3;
new bus;
new news;
new train;
new taxi;
new taxi2;

public OnGameModeInit()
{
	print("GaGlets LS Pack"); // dont change this.. or you get couch! (This script has rulles spoter ! )

	ConnectNPC("[BOT]Mike","seller1");
	ConnectNPC("[BOT]Tom","seller2");
	ConnectNPC("[BOT]Andrew","seller3");
	ConnectNPC("[BOT]Johnson","police");
	ConnectNPC("[BOT]Anderson","police3");
	ConnectNPC("[BOT]Davidson","guard");
	ConnectNPC("[BOT]Moralles","bus");
	ConnectNPC("[BOT]Yards","news");
	ConnectNPC("[BOT]Kelroy","train");
	ConnectNPC("[BOT]Michael","taxi");
	ConnectNPC("[BOT]Roy","taxi2");
	
	seller =	AddStaticVehicle(420, 0, 0, 0, 0, 0, 0); //realy ?
	police =	AddStaticVehicle(597,1535.8085,-1678.8069,13.1522,359.4198,77,100); // police car renew
	police3 =	AddStaticVehicle(597,1524.2937,-1657.2635,13.2267,182.2271,77,100); // POLICE 3
	bus =	AddStaticVehicle(416, 2109.1763, 1503.0453, 32.2887, 82.2873, 3, 6); //bus
	news =	AddStaticVehicle(488,1789.7278,-1571.0643,23.1182,229.1966,2,26); // news
	train =	AddStaticVehicle(407, 2109.1763, 1503.0453, 32.2887, 82.2873, 6, 3); //train
  taxi =	AddStaticVehicle(420,1243.9546,-1835.5270,13.1685,271.4172,6,1); // taxi
  taxi2 =	AddStaticVehicle(420,1016.5422,-1343.6394,13.1480,88.2022,6,1); // taxi2

}

public OnPlayerSpawn(playerid)

{
  	if(!IsPlayerNPC(playerid)) return 0;

		new npcname[64];
		GetPlayerName(playerid,npcname,64);
	
 		if(!strcmp(npcname,"[BOT]Mike",true))
	{
    PutPlayerInVehicle(playerid, seller, 0);
    SetSpawnInfo( playerid, 0, 168,-27.6373,-91.6188,1003.5469,5.1597,0,0,0,0,0,0);
	}
		else if(!strcmp(npcname,"[BOT]Tom",true))
	{
		PutPlayerInVehicle(playerid, seller, 1);
		SetSpawnInfo( playerid, 1, 168,-30.4318,-57.3315,1003.5469,2.3813,0,0,0,0,0,0);
	}
		else if(!strcmp(npcname,"[BOT]Andrew",true))
	{
	  PutPlayerInVehicle(playerid, seller, 2);
	  SetSpawnInfo( playerid, 2, 169,-28.0943,-91.6434,1003.5469,350.4930,0,0,0,0,0,0);
	}
 		else if(!strcmp(npcname,"[BOT]Johnson",true))
	{
    PutPlayerInVehicle(playerid, police, 3);
	}
		else if(!strcmp(npcname,"[BOT]Anderson",true))
	{
		PutPlayerInVehicle(playerid, police3, 4);
	}
		else if(!strcmp(npcname,"[BOT]Davidson",true))
	{
		PutPlayerInVehicle(playerid, seller, 6);
		SetSpawnInfo( playerid, 6, 164,1544.0894,-1631.9235,13.3828,93.1440,0,0,0,0,0,0);
	}
		else if(!strcmp(npcname,"[BOT]Moralles",true))
	{
	  PutPlayerInVehicle(playerid, bus, 7);
	}
		else if(!strcmp(npcname,"[BOT]Yards",true))
	{
		PutPlayerInVehicle(playerid, news, 8);
	}
		else if(!strcmp(npcname,"[BOT]Kelroy",true))
	{
	  PutPlayerInVehicle(playerid, train, 9);
	}
		else if(!strcmp(npcname,"[BOT]Michael",true))
	{
	  PutPlayerInVehicle(playerid, taxi, 11);
	}
		else if(!strcmp(npcname,"[BOT]Roy",true))
	{
	  PutPlayerInVehicle(playerid, taxi2, 12);
	}
		return 1;
}
Reply
#6

This is not your NPC script, remove #include <a_npc> from there.

Now if there still problems, show your NPC script.
Reply
#7

Quote:
Originally Posted by Damn Right M.I.A!
This is not your NPC script, remove #include <a_npc> from there.
You are ok man u havent hited you head somewhere ? this is my script..
i will try to remove it ..
Reply
#8

sorry for DP

I have remade FS
Код:
///////////////////////////////////////////////////////////////////////////////
////////////////////////-GaGlets-LS-PACK-for-SERVERS-//////////////////////////
///////////////////////////////////////////////////////////////////////////////


#include <a_samp>
#include <a_npc>

new seller;
new police;
new police3;
new bus;
new news;
new train;
new taxi;
new taxi2;

public OnGameModeInit()
{
	print("GaGlets LS Pack"); // dont change this.. or you get couch! (This script has rulles spoter ! )

	ConnectNPC("[BOT]Mike","seller1");
	ConnectNPC("[BOT]Tom","seller2");
	ConnectNPC("[BOT]Andrew","seller3");
	ConnectNPC("[BOT]Johnson","police");
	ConnectNPC("[BOT]Anderson","police3");
	ConnectNPC("[BOT]Davidson","guard");
	ConnectNPC("[BOT]Moralles","bus");
	ConnectNPC("[BOT]Yards","news");
	ConnectNPC("[BOT]Kelroy","train");
	ConnectNPC("[BOT]Michael","taxi");
	ConnectNPC("[BOT]Roy","taxi2");
	
	seller =	AddStaticVehicle(420, 0, 0, 0, 0, 0, 0); //realy ?
	police =	AddStaticVehicle(597,1535.8085,-1678.8069,13.1522,359.4198,77,100); // police car renew
	police3 =	AddStaticVehicle(597,1524.2937,-1657.2635,13.2267,182.2271,77,100); // POLICE 3
	bus =	AddStaticVehicle(416, 2109.1763, 1503.0453, 32.2887, 82.2873, 3, 6); //bus
	news =	AddStaticVehicle(488,1789.7278,-1571.0643,23.1182,229.1966,2,26); // news
	train =	AddStaticVehicle(407, 2109.1763, 1503.0453, 32.2887, 82.2873, 6, 3); //train
  taxi =	AddStaticVehicle(420,1243.9546,-1835.5270,13.1685,271.4172,6,1); // taxi
  taxi2 =	AddStaticVehicle(420,1016.5422,-1343.6394,13.1480,88.2022,6,1); // taxi2

}

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, "[BOT]Mike", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, seller, 0); //Putting the NPC into the vehicle we created for it.
    	SetSpawnInfo( playerid, 0, 168,-27.6373,-91.6188,1003.5469,5.1597,0,0,0,0,0,0);
			return 1;
    }
    new npcname2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname2, sizeof(npcname2)); //Getting the NPC's name.
    if(!strcmp(npcname2,"[BOT]Tom",true))
		{
 			PutPlayerInVehicle(playerid, seller, 0);
 	  	SetSpawnInfo( playerid, 1, 168,-30.4318,-57.3315,1003.5469,2.3813,0,0,0,0,0,0);
			return 1;
		}
    new npcname3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname3, sizeof(npcname3)); //Getting the NPC's name.
    if(!strcmp(npcname3, "[BOT]Andrew", true))
    {
      PutPlayerInVehicle(playerid, seller, 0);
	  	SetSpawnInfo( playerid, 2, 168,-28.0943,-91.6434,1003.5469,350.4930,0,0,0,0,0,0);
			return 1;
    }
		new npcname4[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname4, sizeof(npcname4)); //Getting the NPC's name.
    if(!strcmp(npcname4, "[BOT]Johnson", true))
    {
			PutPlayerInVehicle(playerid, police, 0);
			return 1;
    }
		new npcname5[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname5, sizeof(npcname5)); //Getting the NPC's name.
    if(!strcmp(npcname5, "[BOT}Anderson", true))
    {
      PutPlayerInVehicle(playerid, police3, 0);
      return 1;
    }
		new npcname6[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname6, sizeof(npcname6)); //Getting the NPC's name.
    if(!strcmp(npcname6, "[BOT]Davidson", true))
    {
			PutPlayerInVehicle(playerid, seller, 0);
			SetSpawnInfo( playerid, 6, 164,1544.0894,-1631.9235,13.3828,93.1440,0,0,0,0,0,0);
			return 1;
    }
		new npcname7[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname7, sizeof(npcname7)); //Getting the NPC's name.
    if(!strcmp(npcname7, "[BOT}Moralles", true))
    {
      PutPlayerInVehicle(playerid, bus, 0);
      return 1;
    }
		new npcname8[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname8, sizeof(npcname8)); //Getting the NPC's name.
    if(!strcmp(npcname8, "[BOT}Yards", true))
    {
      PutPlayerInVehicle(playerid, news, 0);
      return 1;
    }
		new npcname9[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname9, sizeof(npcname9)); //Getting the NPC's name.
    if(!strcmp(npcname9, "[BOT}Kelroy", true))
    {
      PutPlayerInVehicle(playerid, train, 0);
      return 1;
    }
		new npcname10[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname10, sizeof(npcname10)); //Getting the NPC's name.
    if(!strcmp(npcname10, "[BOT}Michael", true))
    {
      PutPlayerInVehicle(playerid, taxi, 0);
      return 1;
    }
		new npcname11[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname11, sizeof(npcname11)); //Getting the NPC's name.
    if(!strcmp(npcname11, "[BOT}Roy", true))
    {
      PutPlayerInVehicle(playerid, taxi2, 0);
      return 1;
    }
    
    return 1;
  }
  return 1;
}
1st now i have problem with driving npcs, they wouldnt spawn at all but walking npc's respawns all time .

HELP

If i remove a_npc npc wouldnt spawn etc...

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)