SA-MP Forums Archive
Train - 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: Train (/showthread.php?tid=96200)



Train - Kanji_Suzuki - 06.09.2009

Hello

i have made may npc and they all work,
i just added a train one, and it will not enter it
it will just say at the spawn...

i have checked the script 100 times and it all looking ok
im i doing somethink wrong or is it a bug??



Re: Train - Gamer_Z - 06.09.2009

well have u followed kc's NPC tut?
show us your code.


Re: Train - Kanji_Suzuki - 06.09.2009

Quote:
Originally Posted by gamer_Z
well have u followed kc's NPC tut?
show us your code.
as i said i have other bots working (13)
so the code is ok

but here it is
Code:
new BotCar5;
Code:
ConnectNPC("Train_Driver","train");
BotCar5 = CreateVehicle(538, -136.9001,1284.6094,20.6037,94.1330, 1, 1, 50000);
Code:
if(!strcmp(npcname, "Train_Driver", true))
    {
      SetPlayerInterior(playerid,0);
			SetPlayerVirtualWorld(playerid,0);
			SetPlayerSkin(playerid,202);
			PutPlayerInVehicle(playerid, BotCar5, 0);
			return 1;
    }
Code:
#define RECORDING "train" //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



Re: Train - On_Top_Non_Stop - 06.09.2009

I think if you are creating trains you need to use AddStaticVehicle.


Re: Train - Kanji_Suzuki - 07.09.2009

Quote:
Originally Posted by OnTop2K9
I think if you are creating trains you need to use AddStaticVehicle.
yeah, thx, its working now