Guest User

Untitled

a guest
Jun 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. new airportbusVehicle;
  8. new flightlvVehicle;
  9. new flightlsVehicle;
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" NPCs(2 Flights and a Airport Bus) loaded!");
  17. print("--------------------------------------\n");
  18. ConnectNPC("[NPC]Flight to LS","Flight2");
  19. ConnectNPC("[NPC]Airport Shuttle","airportbus");
  20. ConnectNPC("[NPC]Flight to LV","flight1");
  21. airportbusVehicle = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  22. flightlvVehicle = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  23. flightlsVehicle = CreateVehicle(519, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
  24. return 1;
  25. }
  26.  
  27. public OnFilterScriptExit()
  28. {
  29. return 1;
  30. }
  31.  
  32. #else
  33.  
  34. main()
  35. {
  36. print("\n----------------------------------");
  37. print(" NPCs by Daniel Schumacher 98");
  38. print("----------------------------------\n");
  39. }
  40.  
  41. #endif
  42.  
  43. public OnPlayerSpawn(playerid)
  44. {
  45. if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  46. {
  47. new npcname[MAX_PLAYER_NAME];
  48. GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
  49. if(!strcmp(npcname, "Airportbus", true)) //Checking if the NPC's name is MyFirstNPC
  50. {
  51. PutPlayerInVehicle(playerid, airportbusVehicle, 0); //Putting the NPC into the vehicle we created for it.
  52. return 1;
  53. }
  54. if(!strcmp(npcname, "flight1", true))
  55. {
  56. PutPlayerInVehicle(playerid, flightlvVehicle, 0);
  57. return 1;
  58. }
  59. if(!strcmp(npcname, "Flight2", true))
  60. {
  61. PutPlayerInVehicle(playerid, flightlsVehicle, 0);
  62. return 1;
  63. }
  64. return 1;
  65. }
  66. return 1;
  67. }
Add Comment
Please, Sign In to add comment