Advertisement
Guest User

[NPC] LS Bus System

a guest
Apr 13th, 2010
1,665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.18 KB | None | 0 0
  1. //Note
  2. /*This is a [NPC]Filterscript  made by Adil.
  3.   This Filter script allows you to travel through LS with a [NPC] who drives the Bus.
  4.   I basically made this for RP servers.
  5.   If you are facing some problems then read the tutorial or post your problem on the release page.
  6.   Please you are requested to not to remove the credits, thankyou.
  7.   For further support, this is my forums profile http://forum.sa-mp.com/index.php?action=profile;u=44331
  8.   Enjoy.*/
  9.  
  10. //Includes
  11. #include <a_samp>
  12.  
  13. //Defines
  14. #define COLOR_LIGHTBLUE 0x33CCFFAA
  15. #define COLOR_RED 0xFF0000FF
  16.  
  17. //News
  18. new NPCBus;
  19.  
  20. //Forwards
  21. forward IsAtBusStop(playerid);
  22.  
  23. //Publics
  24. public OnFilterScriptInit()
  25. {
  26.     print("                                ");
  27.     print("\n--------------------------------");
  28.     print("  Adil's [NPC]LS Bus System.");
  29.     print("--------------------------------\n");
  30.     print("                                ");
  31.     ConnectNPC("Busdriver","Bus");
  32.    
  33.     //Vehicles
  34.     NPCBus = CreateVehicle(431, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
  35.    
  36.     //Objects
  37.     CreateObject(1257, 2243.8464355469, -1725.9122314453, 13.826066970825, 0, 0, 90);
  38.     CreateObject(1257, 1188.8359375, -1354.6279296875, 13.848303794861, 0, 0, 179.99450683594);
  39.     CreateObject(1257, 1948.3315429688, -1454.3532714844, 13.826066970825, 0, 0, 90);
  40.     CreateObject(1257, 1860.3641357422, -1160.7390136719, 24.132461547852, 0, 0, 180);
  41.     CreateObject(1257, 1571.0646972656, -2188.0112304688, 13.826066970825, 0, 0, 90);
  42.     CreateObject(1257, 393.74227905273, -1766.5667724609, 5.8194541931152, 0, 0, 90);
  43.     CreateObject(1257, 850.67614746094, -1333.9708251953, 13.915329933167, 0, 0, 270);
  44.     CreateObject(1257, 2295.6674804688, -2288.6452636719, 13.826066970825, 0, 0, 315);
  45.     CreateObject(1257, 1705.5905761719, -1805.8479003906, 13.826066970825, 0, 0, 90);
  46.     CreateObject(1257, 2636.3247070313, -1693.1252441406, 11.185441970825, 0, 0, 180);
  47.     CreateObject(1257, 2868.9033203125, -1416.4068603516, 11.331715583801, 0, 0, 180);
  48.     CreateObject(1257, 1567.0969238281, -1725.4758300781, 13.826066970825, 0, 0, 90);
  49.     return 1;
  50. }
  51.  
  52. public OnFilterScriptExit()
  53. {
  54.     return 1;
  55. }
  56.  
  57. public OnPlayerSpawn(playerid)
  58. {
  59.     if(IsPlayerNPC(playerid))
  60.     {
  61.         new npcname[MAX_PLAYER_NAME];
  62.         GetPlayerName(playerid, npcname, sizeof(npcname));
  63.         if(!strcmp(npcname, "Busdriver", true))
  64.         {
  65.             PutPlayerInVehicle(playerid, NPCBus, 0);
  66.             SetPlayerSkin(playerid, 255);
  67.             ResetPlayerWeapons(playerid);
  68.         }
  69.         return 1;
  70.     }
  71.     return 1;
  72. }
  73.  
  74. public OnPlayerCommandText(playerid, cmdtext[])
  75. {
  76.     if (strcmp("/Route", cmdtext, true, 6) == 0)
  77.     {
  78.         if(IsAtBusStop(playerid))
  79.         {
  80.             SendClientMessage(playerid, COLOR_LIGHTBLUE, "Bus Route: East Beach - Stadium - Ganton - Idlewood - Glen Park - All Saints - Market Station - Santa Maria Beach - Crane.");
  81.         }
  82.         return 1;
  83.     }
  84.     if (strcmp("/Gotobus", cmdtext, true, 3) == 0)
  85.     {
  86.         if(!IsPlayerAdmin(playerid))
  87.         {
  88.             SendClientMessage(playerid, COLOR_RED, "You are not authorised to use this command.");
  89.             return 1;
  90.         }
  91.         PutPlayerInVehicle(playerid, NPCBus, 2);
  92.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "You were teleported into the bus");
  93.         return 1;
  94.     }
  95.     return 0;
  96. }
  97.  
  98. public IsAtBusStop(playerid)
  99. {
  100.     if(IsPlayerConnected(playerid))
  101.     {
  102.         if(IsPlayerInRangeOfPoint(playerid,3.0,2868.9622,-1416.5736,11.0518) || IsPlayerInRangeOfPoint(playerid,3.0,1860.4075,-1159.9828,23.8553) || IsPlayerInRangeOfPoint(playerid,3.0,1189.1868,-1354.8392,13.5687)
  103.            || IsPlayerInRangeOfPoint(playerid,3.0,850.7612,-1333.9199,13.6376) || IsPlayerInRangeOfPoint(playerid,3.0,2243.9165,-1726.0015,13.5469) || IsPlayerInRangeOfPoint(playerid,3.0,2636.3699,-1692.7764,10.9063)
  104.            || IsPlayerInRangeOfPoint(playerid,3.0,1948.7146,-1454.3983,13.5469) || IsPlayerInRangeOfPoint(playerid,3.0,393.6521,-1766.6113,5.5408) || IsPlayerInRangeOfPoint(playerid,3.0,1567.2344,-1725.5209,13.5469)
  105.            || IsPlayerInRangeOfPoint(playerid,3.0,1705.7418,-1806.0801,13.5469) || IsPlayerInRangeOfPoint(playerid,3.0,1570.9974,-2188.0564,13.5469) || IsPlayerInRangeOfPoint(playerid,3.0,2295.2600,-2288.5183,13.5469))
  106.         {
  107.             return 1;
  108.         }
  109.     }
  110.     return 0;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement