Guest User

Untitled

a guest
Nov 4th, 2016
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.89 KB | None | 0 0
  1. /**************************************************************************/
  2. // Yaa NPC System
  3. /*************************************************************************/
  4. /**************************************************************************/
  5. // Version 1.0 | Build 1
  6. /*************************************************************************/
  7. /**
  8. * Copyright (c) 2015-2016 San Andreas Playground
  9. *
  10. * This program is free software: you can redistribute it and/or modify it under the terms of the
  11. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  15. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with this program.
  19. * If not, see <http://www.gnu.org/licenses/>.
  20. */
  21.  
  22. /*AUTHOR ********************
  23. @Yaa - SA-MP Lead Scripter
  24. ***************************/
  25.  
  26.  
  27. #include <a_samp>
  28.  
  29. #pragma tabsize 0
  30.  
  31. #define COLOR_GREEN 0x33AA33AA
  32. #define COLOR_RED 0xE01B4CFF
  33.  
  34. new Busdama[3];
  35. new BusPick;
  36.  
  37. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  38. {
  39. if(IsPlayerAdmin(playerid))
  40. {
  41. SetPlayerPos(playerid, fX, fY, fZ);
  42. }
  43. return 1;
  44. }
  45. public OnFilterScriptInit()
  46. {
  47. ConnectNPC("[SAP]Bus[65]", "Gunthers");
  48. ConnectNPC("[SAP]Bus[52]", "Guntherss");
  49. ConnectNPC("[SAP]Bus[07]", "SAP07");
  50. ConnectNPC("[SAP]Bus[30]", "SAP30");
  51. ConnectNPC("[SAP]Bus[40]", "SAP40");
  52. ConnectNPC("[SAP]Bus[57]", "SAP57");
  53. ConnectNPC("[SAP]Bus[18]", "SAP18");
  54.  
  55. BusPick = CreatePickup(19130, 2, 2030.3916,1520.7435,10.8203, -1);
  56. Busdama[0] = CreateVehicle(437,-2037.8804000,139.2291000,29.2285000,270.9555000,-1,-1,15);
  57. new Text3D:label = Create3DTextLabel("(SF) Pirates Ship <-> (LV) Area 69 \n --------\n 78 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  58. Attach3DTextLabelToVehicle( Text3D:label, Busdama[0], 0.0, 0.0, 2.0);
  59.  
  60. Busdama[2] = CreateVehicle(437,-2032.6281000,174.0752000,29.2325000,294.2687000,-1,-1,15);
  61. new Text3D:label2 = Create3DTextLabel("(LV) SF Chinatown <-> (LV) Emerald Isle\n --------\n 32 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  62. Attach3DTextLabelToVehicle( Text3D:label2, Busdama[2], 0.0, 0.0, 2.0);
  63.  
  64. Busdama[2] = CreateVehicle(437,-2032.6281000,174.0752000,29.2325000,294.2687000,-1,-1,15);
  65. new Text3D:label3 = Create3DTextLabel("(LV) SF Chinatown <-> (LV) Emerald Isle\n --------\n 32 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  66. Attach3DTextLabelToVehicle( Text3D:label3, Busdama[2], 0.0, 0.0, 2.0);
  67.  
  68. return 1;
  69. }
  70. public OnPlayerConnect(playerid)
  71. {
  72. GameTextForPlayer(playerid,"SAP : test script",5000,5);
  73. return 1;
  74. }
  75.  
  76. public OnPlayerSpawn(playerid)
  77. {
  78. NPCTest(playerid);
  79. return 1;
  80. }
  81.  
  82. public OnPlayerPickUpPickup(playerid, pickupid)
  83. {
  84. if(pickupid == BusPick)
  85. {
  86. SendClientMessage(playerid, COLOR_GREEN, "____________________________| Bus's Actives |_____________________________");
  87. SendClientMessage(playerid, -1, " ");
  88. SendClientMessage(playerid, COLOR_RED, "Number : 32 | SF Chinatown <-> LV Emerald Isle | Damaged");
  89. SendClientMessage(playerid, COLOR_RED, "Number : 04 | SF Industrial Area <-> LS Grouve Street | Damaged");
  90. SendClientMessage(playerid, COLOR_RED, "Number : 78 | SF Pirates Ship <-> LV Area 69 | Damaged");
  91. SendClientMessage(playerid, COLOR_GREEN, "Number : 57 | SF Train Station <-> (SF-LV) The Small Village | Active ");
  92. SendClientMessage(playerid, COLOR_GREEN, "Number : 18 | SF Police Office <-> (LS Beach) Vachet Harbor | Active ");
  93. SendClientMessage(playerid, COLOR_GREEN, "Number : 40 | Las Venturas <-> Las Barrancas | Active ");
  94. SendClientMessage(playerid, COLOR_GREEN, "Number : 65 | LV Pirates Ship <-> SF Pirates Ship | Active ");
  95. SendClientMessage(playerid, COLOR_GREEN, "Number : 52 | LV Emerald Isle <-> LS Grouve Street | Active ");
  96. SendClientMessage(playerid, COLOR_GREEN, "Number : 30 | LV Police Departemment <-> Mount Chilliad | Active ");
  97. SendClientMessage(playerid, COLOR_GREEN, "Number : 07 | LV Ammo Nation <-> LV Area 69 | Active ");
  98. SendClientMessage(playerid, COLOR_GREEN, "__________________________________________________________________________");
  99. return 0;
  100. }
  101. return 1;
  102. }
  103.  
  104. stock NPCTest(playerid)
  105. {
  106. if(IsPlayerNPC(playerid))
  107. {
  108. new npcname[MAX_PLAYER_NAME];
  109. GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
  110. if(!strcmp(npcname, "[SAP]Bus[65]", true))
  111. {
  112. new Text3D:label = Create3DTextLabel("(LV) Pirates Ship <-> (SF) Pirates Ship\n --------\n 65 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Near LV Airport
  113. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  114. new NPCar;
  115. new Float:X,Float:Y,Float:Z,Float:Angle;
  116. GetPlayerPos(playerid,X,Y,Z);
  117. GetPlayerFacingAngle(playerid,Angle);
  118. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  119. PutPlayerInVehicle(playerid,NPCar,0);
  120. }
  121. if(!strcmp(npcname, "[SAP]Bus[52]", true))
  122. {
  123. new Text3D:label = Create3DTextLabel("(LV) Emerald Isle <-> (LS) Grouve Street\n --------\n 52 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  124. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  125. new NPCar;
  126. new Float:X,Float:Y,Float:Z,Float:Angle;
  127. GetPlayerPos(playerid,X,Y,Z);
  128. GetPlayerFacingAngle(playerid,Angle);
  129. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  130. PutPlayerInVehicle(playerid,NPCar,0);
  131. }
  132. if(!strcmp(npcname, "[SAP]Bus[07]", true))
  133. {
  134. new Text3D:label = Create3DTextLabel("(LV) Ammo Nation <-> (LV - SF) Area 69\n --------\n 07 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  135. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  136. new NPCar;
  137. new Float:X,Float:Y,Float:Z,Float:Angle;
  138. GetPlayerPos(playerid,X,Y,Z);
  139. GetPlayerFacingAngle(playerid,Angle);
  140. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  141. PutPlayerInVehicle(playerid,NPCar,0);
  142. }
  143. if(!strcmp(npcname, "[SAP]Bus[30]", true))
  144. {
  145. new Text3D:label = Create3DTextLabel("(LV) Police Departemment <-> (LS - SF) Mount Chilliad\n --------\n 30 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  146. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  147. new NPCar;
  148. new Float:X,Float:Y,Float:Z,Float:Angle;
  149. GetPlayerPos(playerid,X,Y,Z);
  150. GetPlayerFacingAngle(playerid,Angle);
  151. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  152. PutPlayerInVehicle(playerid,NPCar,0);
  153. }
  154. if(!strcmp(npcname, "[SAP]Bus[40]", true))
  155. {
  156. new Text3D:label = Create3DTextLabel("(T-LV) Las Venturas <-> (LV - SF) Las Barrancas\n --------\n 40 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  157. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  158. new NPCar;
  159. new Float:X,Float:Y,Float:Z,Float:Angle;
  160. GetPlayerPos(playerid,X,Y,Z);
  161. GetPlayerFacingAngle(playerid,Angle);
  162. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  163. PutPlayerInVehicle(playerid,NPCar,0);
  164. }
  165. if(!strcmp(npcname, "[SAP]Bus[18]", true))
  166. {
  167. new Text3D:label = Create3DTextLabel("(SF) Police Office <-> (LS Beach) Vachet Harbor\n --------\n 18 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  168. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  169. new NPCar;
  170. new Float:X,Float:Y,Float:Z,Float:Angle;
  171. GetPlayerPos(playerid,X,Y,Z);
  172. GetPlayerFacingAngle(playerid,Angle);
  173. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  174. PutPlayerInVehicle(playerid,NPCar,0);
  175. }
  176. if(!strcmp(npcname, "[SAP]Bus[57]", true))
  177. {
  178. new Text3D:label = Create3DTextLabel("(SF) Train Station <-> (SF-LV) The Small Village\n --------\n 57 \n--------", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); // Red Country
  179. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  180. new NPCar;
  181. new Float:X,Float:Y,Float:Z,Float:Angle;
  182. GetPlayerPos(playerid,X,Y,Z);
  183. GetPlayerFacingAngle(playerid,Angle);
  184. NPCar = CreateVehicle(437,X,Y,Z,Angle,0,0,0);
  185. PutPlayerInVehicle(playerid,NPCar,0);
  186. }
  187. if(!strcmp(npcname, "[LV]Ship[01]", true))
  188. {
  189. new Text3D:label = Create3DTextLabel("San Andreas Playground LV Pirates Ship\n Please Fighting / slaping / abuse\n are not allowed in the ship", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  190. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  191. SetPlayerSkin(playerid, 217);
  192. GivePlayerWeapon(playerid, 38, 19000);
  193. }
  194. if(!strcmp(npcname, "[LV]Ship[02]", true))
  195. {
  196. new Text3D:label = Create3DTextLabel("San Andreas Playground LV Pirates Ship\n Please CARS / PLANES / BIKES / Bombs\n are not allowed in the ship", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  197. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  198. SetPlayerSkin(playerid, 217);
  199. GivePlayerWeapon(playerid, 38, 19000);
  200. }
  201. }
  202. }
Advertisement
Add Comment
Please, Sign In to add comment