SA-MP Forums Archive
[NPC] Adil's LS Bus System - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [NPC] Adil's LS Bus System (/showthread.php?tid=141433)

Pages: 1 2


[NPC] Adil's LS Bus System - Adil - 13.04.2010

[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-
Pastebin



Re: [NPC] LS Bus System - asdfgh98 - 13.04.2010

Nice, very usefull i will use it


Re: [NPC] LS Bus System - XRVX - 13.04.2010

looks good man
nice work!


Re: [NPC] LS Bus System - siwarak - 13.04.2010

good job

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


Re: [NPC] LS Bus System - ViruZZzZ_ChiLLL - 13.04.2010

Nice!
________
New Mexico Medical Marijuana Dispensaries


Re: [NPC] LS Bus System - Adil - 13.04.2010

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.


Re: [NPC] LS Bus System - J-Sprunk - 13.04.2010

Nice job,man


Re: [NPC] LS Bus System - korana71 - 13.04.2010

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


Re: [NPC] LS Bus System - Adil - 13.04.2010

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 ?


Re: [NPC] LS Bus System - korana71 - 13.04.2010

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


Re: [NPC] LS Bus System - Adil - 13.04.2010

Does that gamemode require a login ?

Are you sure you put all the files in the correct place ?


Re: [NPC] LS Bus System - Roymer - 13.04.2010

yes


Re: [NPC] LS Bus System - Adil - 13.04.2010

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.


Re: [NPC] LS Bus System - Roymer - 13.04.2010

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.



Re: [NPC] LS Bus System - Thrarod - 14.04.2010

:S Are you sure you pasted it correctly?


Re: [NPC] LS Bus System - Desert - 14.04.2010

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


Re: [NPC] LS Bus System - Adil - 14.04.2010

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


Re: [NPC] Adil's LS Bus System - s1cr0n - 15.04.2010

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.


Re: [NPC] Adil's LS Bus System - Adil - 15.04.2010

What script are you using ?

Try putting it in your OnPlayerEnterVehicle.


Re: [NPC] Adil's LS Bus System - s1cr0n - 15.04.2010

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;
}