Advertisement
tuss

delivery job

Aug 2nd, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //textdraws
  4. new Text: LoadText;
  5. new Text: LoadingText;
  6.  
  7. //job
  8. new StartingDeliveryJob[256];
  9.  
  10. //colors
  11. #define COLOR_GREY 0xB4B5B7FF
  12.  
  13. new X_DeliveryPay[][] =// Delivery Job Random Pay Amount, you can change it if you want.
  14. {
  15. {142},
  16. {147},
  17. {144},
  18. {149},
  19. {138},
  20. {152},
  21. {154},
  22. {145}
  23. };
  24. new Float: X_DeliveryCheckpoints[][7] =// Delivery Job Checkpoints
  25. {
  26. {1837.9658,-1832.2373,13.5854}, // Unity 24/7
  27. {2235.0100,-1724.6320,13.5497}, // Ganton Gym
  28. {2305.2690,-1640.0338,14.4774}, // Ten Green Bottles
  29. {2412.6970,-1481.5623,23.8281}, // East Los Santos Cluckin' Bell
  30. {2431.3489,-1224.8230,25.3842}, // Pig Pen
  31. {788.9443,-1612.3558,13.3828}, // Marina Burger Shot
  32. {363.5080,-2030.5432,7.8359} // Store on docks
  33. };
  34. #if defined FILTERSCRIPT
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("tuss's delivery job loaded.");
  39. return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44. return 1;
  45. }
  46.  
  47. #else
  48.  
  49. main()
  50. {
  51. print("\n----------------------------------");
  52. print(" Blank Gamemode by your name here");
  53. print("----------------------------------\n");
  54. }
  55.  
  56. #endif
  57.  
  58. public OnGameModeInit()
  59. {
  60. // Don't use these lines if it's a filterscript
  61. SetGameModeText("Blank Script");
  62. AddPlayerClass(0, 1821.2747,-1127.3339,24.0781,17.0622, 0, 0, 0, 0, 0, 0);
  63. return 1;
  64. }
  65.  
  66. public OnGameModeExit()
  67. {
  68. return 1;
  69. }
  70.  
  71. public OnPlayerRequestClass(playerid, classid)
  72. {
  73. SetPlayerPos(playerid, 1821.2747,-1127.3339,24.0781);
  74. SetPlayerCameraPos(playerid, 1821.2747,-1127.3339,24.0781);
  75. SetPlayerCameraLookAt(playerid, 1821.2747,-1127.3339,24.0781);
  76. return 1;
  77. }
  78.  
  79. public OnPlayerConnect(playerid)
  80. {
  81. // textdraws that display when user types /load
  82. LoadingText = TextDrawCreate(75,312,"~g~ITEMS LOADING...~n~~w~ Please wait.");
  83. TextDrawAlignment(LoadingText, 2);
  84. TextDrawBackgroundColor(LoadingText, 255);
  85. TextDrawFont(LoadingText, 1);
  86. TextDrawLetterSize(LoadingText, 0.200000, 0.700000);
  87. TextDrawColor(LoadingText, -1);
  88. TextDrawSetOutline(LoadingText, 1);
  89. TextDrawSetProportional(LoadingText, 1);
  90. TextDrawSetShadow(LoadingText, 1);
  91.  
  92. LoadText = TextDrawCreate(75,312,"~g~ITEMS LOADED:~n~~w~ Deliver them to the checkpoints.");
  93. TextDrawAlignment(LoadText, 2);
  94. TextDrawBackgroundColor(LoadText, 255);
  95. TextDrawFont(LoadText, 1);
  96. TextDrawLetterSize(LoadText, 0.200000, 0.700000);
  97. TextDrawColor(LoadText, -1);
  98. TextDrawSetOutline(LoadText, 1);
  99. TextDrawSetProportional(LoadText, 1);
  100. TextDrawSetShadow(LoadText, 1);
  101.  
  102. StartingDeliveryJob[playerid] = 0;
  103. return 1;
  104. }
  105.  
  106. public OnPlayerDisconnect(playerid, reason)
  107. {
  108. return 1;
  109. }
  110.  
  111. public OnPlayerSpawn(playerid)
  112. {
  113. return 1;
  114. }
  115.  
  116. public OnPlayerDeath(playerid, killerid, reason)
  117. {
  118. StartingDeliveryJob[playerid] = 0;
  119. return 1;
  120. }
  121.  
  122. public OnVehicleSpawn(vehicleid)
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnVehicleDeath(vehicleid, killerid)
  128. {
  129. return 1;
  130. }
  131.  
  132. public OnPlayerText(playerid, text[])
  133. {
  134. return 1;
  135. }
  136.  
  137. public OnPlayerCommandText(playerid, cmdtext[])
  138. {
  139. if (strcmp("/load", cmdtext, true, 10) == 0)
  140. {
  141. new
  142. rand = random(sizeof(X_DeliveryCheckpoints));
  143. if(StartingDeliveryJob[playerid] == 1)
  144. {
  145. SendClientMessage(playerid, COLOR_GREY, "You are already doing the delivery job");
  146. return 1;
  147. }
  148. if(!IsPlayerInRangeOfPoint(playerid, 7, 1822.7450,-1145.6880,23.9617))
  149. {
  150. SetPlayerCheckpoint(playerid, 1822.7450,-1145.6880,23.9617, 4);
  151. SendClientMessage(playerid, COLOR_GREY, "You are not at the item pickup point. It has been marked on your map.");
  152. return 1;
  153. }
  154. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 543)
  155. {
  156. {
  157. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  158. {
  159. StartingDeliveryJob[playerid] = 1;
  160. SetPlayerCheckpoint(playerid, X_DeliveryCheckpoints[rand][0], X_DeliveryCheckpoints[rand][1], X_DeliveryCheckpoints[rand][2], 4);
  161. SendClientMessage(playerid, COLOR_GREY, "You have loaded some items into your sadler.");
  162. TogglePlayerControllable(playerid, 0);
  163. TextDrawShowForPlayer(playerid,LoadingText);
  164. SetTimer("GetLoadingText", 3000, false);
  165. PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0);
  166. return 1;
  167. }
  168. }
  169. }
  170. SendClientMessage(playerid, COLOR_GREY, "You are not in a sadler.");
  171. return 1;
  172. }
  173. return 0;
  174. }
  175.  
  176. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnPlayerExitVehicle(playerid, vehicleid)
  182. {
  183. if(StartingDeliveryJob[playerid])
  184. {
  185. StartingDeliveryJob[playerid] = 0;
  186. DisablePlayerCheckpoint(playerid);
  187. GameTextForPlayer(playerid, "~r~Stopped delivering.", 3000, 4);
  188. }
  189. return 1;
  190. }
  191.  
  192. public OnPlayerStateChange(playerid, newstate, oldstate)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnPlayerEnterCheckpoint(playerid)
  198. {
  199. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 543)
  200. {
  201. if(StartingDeliveryJob[playerid] == 1)
  202. {
  203. new
  204. rand = random(sizeof(X_DeliveryCheckpoints)), msg[128];
  205. format(msg, sizeof(msg), "You have received $%d from delivering the items. Go back to the item pickup to get more!", X_DeliveryPay[rand][0]);
  206. SendClientMessage(playerid, COLOR_GREY, msg);
  207. GivePlayerMoney(playerid, X_DeliveryPay[rand][0]);
  208. StartingDeliveryJob[playerid] = 0;
  209. DisablePlayerCheckpoint(playerid);
  210. }
  211. }
  212. return 1;
  213. }
  214.  
  215. public OnPlayerLeaveCheckpoint(playerid)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerEnterRaceCheckpoint(playerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnPlayerLeaveRaceCheckpoint(playerid)
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnRconCommand(cmd[])
  231. {
  232. return 1;
  233. }
  234.  
  235. public OnPlayerRequestSpawn(playerid)
  236. {
  237. return 1;
  238. }
  239.  
  240. public OnObjectMoved(objectid)
  241. {
  242. return 1;
  243. }
  244.  
  245. public OnPlayerObjectMoved(playerid, objectid)
  246. {
  247. return 1;
  248. }
  249.  
  250. public OnPlayerPickUpPickup(playerid, pickupid)
  251. {
  252. return 1;
  253. }
  254.  
  255. public OnVehicleMod(playerid, vehicleid, componentid)
  256. {
  257. return 1;
  258. }
  259.  
  260. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  261. {
  262. return 1;
  263. }
  264.  
  265. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  266. {
  267. return 1;
  268. }
  269.  
  270. public OnPlayerSelectedMenuRow(playerid, row)
  271. {
  272. return 1;
  273. }
  274.  
  275. public OnPlayerExitedMenu(playerid)
  276. {
  277. return 1;
  278. }
  279.  
  280. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  281. {
  282. return 1;
  283. }
  284.  
  285. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  286. {
  287. return 1;
  288. }
  289.  
  290. public OnRconLoginAttempt(ip[], password[], success)
  291. {
  292. return 1;
  293. }
  294.  
  295. public OnPlayerUpdate(playerid)
  296. {
  297. return 1;
  298. }
  299.  
  300. public OnPlayerStreamIn(playerid, forplayerid)
  301. {
  302. return 1;
  303. }
  304.  
  305. public OnPlayerStreamOut(playerid, forplayerid)
  306. {
  307. return 1;
  308. }
  309.  
  310. public OnVehicleStreamIn(vehicleid, forplayerid)
  311. {
  312. return 1;
  313. }
  314.  
  315. public OnVehicleStreamOut(vehicleid, forplayerid)
  316. {
  317. return 1;
  318. }
  319.  
  320. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  321. {
  322. return 1;
  323. }
  324.  
  325. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  326. {
  327. return 1;
  328. }
  329. forward GetLoadingText(playerid);
  330. public GetLoadingText(playerid)
  331. {
  332. TogglePlayerControllable(playerid, 1);
  333. TextDrawHideForPlayer(playerid,LoadingText);
  334. TextDrawShowForPlayer(playerid,LoadText);
  335. SetTimer("GetLoadText", 4000, false);
  336. return 1;
  337. }
  338. forward GetLoadText(playerid);
  339. public GetLoadText(playerid)
  340. {
  341. TextDrawHideForPlayer(playerid,LoadText);
  342. return 1;
  343. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement