[NPC] Adil's LS Bus System
#1

[NPC] LS Bus System
_________________________________________________

-Introduction-
This is a Non Playing Character (also known as NPC or Bot) filterscript created basically for RP servers. The Bot drives a bus all around Los Santos. There are also some Bus stops placed in LS, twelve Bus stops actually. The NPC driving the bus will take you to all the Bus stops, not knowing your actual destination. He will stop for some time at the bus stops so the passengers can exit the bus, and the people who want to get in the bus can easily get in for a luxurious drive to their destination. You can use the /Route command if you're near any of the Bus stops to know the Routes of the Bus. You can also use /Gotobus to get in the bus as a passenger if you are logged in as Rcon Admin. The usage of this Filterscript is quite simple and easy.

-Information-
Name:[NPC]LS Bus System
Release date:13/April/2010
Commands:2
Objects:12
NPCs:1
Vehicles:1
-Screenshots-

-Installation-
Open the [NPC]Bus System.zip file and extract it anywhere. Open the extracted file and then open the filterscripts folder. Copy BSystem.pwn and BSystem.amx and paste it in your filterscripts folder. Then open the extracted folder again and go into npcmodes. Copy Bus.pwn and Bus.amx and paste it into your npcmodes folder. Then open the extracted folder again and open the recordings folder inside npcmodes. Copy "Bus" and paste it into your recordings folder. Open your server.cfg and if your "maxnpc" is 0 then change it to "maxnpc 1" or more if your using other NPCs too. Put BSystem after the line of filterscripts, make it look like this: "filterscripts BSystem". Save it and then open samp-server. It should work, otherwise post in your problem.

-Download-
Reply
#2

Nice, very usefull i will use it
Reply
#3

looks good man
nice work!
Reply
#4

good job

i want npc SF Bus same you can make for me hehe
Reply
#5

Nice!
________
New Mexico Medical Marijuana Dispensaries
Reply
#6

Thanks.
Quote:
Originally Posted by siwarak
good job

i want npc SF Bus same you can make for me hehe
I'll tell you later.
Reply
#7

Nice job,man
Reply
#8

Hello!

I have this problem and please help me! when i start my server write : NPC join: Busdriver .....
but in 5 seconds write : NPC part: Bus Driver Left The server.
Screen :


Please Help me and also Sorry my Bad English
Reply
#9

Quote:
Originally Posted by korana71
Hello!

I have this problem and please help me! when i start my server write : NPC join: Busdriver .....
but in 5 seconds write : NPC part: Bus Driver Left The server.
Screen :


Please Help me and also Sorry my Bad English
What gamemode are you using ?
Reply
#10

Eroleplay Sir
http://forum.sa-mp.com/index.php?topic=158030.0
Reply
#11

Does that gamemode require a login ?

Are you sure you put all the files in the correct place ?
Reply
#12

yes
Reply
#13

Quote:
Originally Posted by Roymer
yes
pawn Code:
if(IsPlayerNPC(playerid))
{
  return 1;
}
Put this code below public onplayerconenct, onplayerspawn and onplayerrequest and then tell me the result.
Reply
#14

Errors :

pawn Code:
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(3890) : error 036: empty statement
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(3894) : warning 225: unreachable code
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(5791) : error 036: empty statement
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(5795) : warning 225: unreachable code
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(10014) : error 036: empty statement
C:\Documents and Settings\Pierson\Escritorio\Copia de Servidor\gamemodes\Al-Rp.pwn(10018) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Reply
#15

:S Are you sure you pasted it correctly?
Reply
#16

To make it fit less you could do it this way

if(IsPlayerNPC(playerid)) return 1; on the first line of callbacks like OnPlayerRequestSpawn and OnPlayerSpawn

I use that and i have 5 NPC connecting with no problem
Reply
#17

Paste this one
pawn Code:
if(IsPlayerNPC(playerid)) return 1;
I copied the wrong one before.
Reply
#18

Hello,

I can't get your filterscript to work.

The npc joins the server, and then just stays normally at civilian spawn point.

I allready have tryed:

Code:
public OnPlayerSpawn(playerid)
{
//----------- NPC-s ----
	if(IsPlayerNPC(playerid))
	{
		new npcname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname, sizeof(npcname));
		if(!strcmp(npcname, "Busdriver", true))
		{
		 SetPVarInt(playerid, "pJob", 14);
		 SetSpawnInfo(playerid,0,255,1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
		 PutPlayerInVehicle(playerid, NPCBus, 0);
		 printf("DEBUG:NPC %s Spawned and Set to vehicle %d",npcname,NPCBus);
		 SetPlayerSkin(playerid, 255);
		 ResetPlayerWeapons(playerid);
		 return 1;
		}
		return 1;
	}
//---------------------
Code:
public OnPlayerRequestClass(playerid, classid)
{
  if(IsPlayerNPC(playerid))
	{
	  SpawnPlayer(playerid);
		return 1;
	}

Code:
public OnPlayerRequestSpawn(playerid)
{
	if(IsPlayerNPC(playerid))
	{
		new npcname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, npcname, sizeof(npcname));
		if(!strcmp(npcname, "Busdriver", true))
		{
			SetSpawnInfo(playerid,61,61,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
			SpawnPlayer(playerid);
		}
		return 1;
	}
}
Removing the restriction from buses (there was an restriction for bus driver job).
Modifying all my loops so that won't cycle trough NPC-s.

I've tryed adding the npc in OnGameModeInit
or
with custom command

Code:
COMMAND:testnpc(playerid,params[]) // debug
{
	if (GetPVarInt(playerid, "pAdmin") >= 4)
	{
		ConnectNPC("Busdriver","Bus");
	}
	return 1;
}
Code:
COMMAND:pic(playerid,params[]) // debug
{
	if (GetPVarInt(playerid, "pAdmin") >= 4)
	{
		new user, masina;
		if (sscanf(params, "ud", user,masina)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /testnpc [playerid/PartOfName] [idmasina]");
		PutPlayerInVehicle(user, masina, 0);
	}
	return 1;
}
I can get the NPC join the server in any method but it can't convince it to drive the bus.
/pic (put in car) command only works first(for a fraction of second), then I don't see any change.

If I respawn the NPC, it stays freezed somewhere in the air flickering.

Any other suggestions ?

Thank you.
Reply
#19

What script are you using ?

Try putting it in your OnPlayerEnterVehicle.
Reply
#20

I'm using a personal script.. 30k+ lines. Full mysql, no edit.
Quote:
Originally Posted by Adil_Rahoo
Try putting it in your OnPlayerEnterVehicle.
Putting what in OnPlayerEnterVehicle ?


This is all i got in OnPlayerEnterVehicle

Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if (GetPlayerSurfingVehicleID(playerid) == vehicleid)
	{
		ClearAnimations(playerid);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)