Advertisement
Guest User

Job

a guest
Mar 12th, 2012
2,818
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.01 KB | None | 0 0
  1. /////////Job FilterScript by Rangerxxll///////////
  2. ////////Feel free to edit it in any way. I'm not worried about credits, this took me 10 minutes to make/////////
  3. ////////V1.00, I plan on adding more jobs to it. Such as a flying job, pizza boy, mail man, and all of that.//////
  4. /////// Check my Forums post to stay updated, on forum.sa-mp.com//////////
  5.  
  6.  
  7. // Includes.
  8. #include <a_samp>
  9. #include <sscanf2>
  10. #include <zcmd>
  11. //Defining the checkpoints
  12. #define startcp 2460.6772,-2120.8718,13.5530
  13. #define cp1 2376.2813,-1906.0054,13.3828
  14. #define cp2 2445.0811,-1761.3519,13.5865
  15. #define cp3 2475.5999,-1528.2408,24.0023
  16. #define cp4 2421.6868,-1223.6115,25.2789
  17. //color
  18. #define COLOR_LIGHTCYAN 0xAAFFCC33
  19. #define COLOR_BLUEGREEN 0x46BBAA00
  20. #define COLOR_RED 0xAA3333AA
  21. //variable for checkpoints
  22. new atcp[MAX_PLAYERS];
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n--------------------------------------");
  27. print(" Job Filterscript by Rangerxxll(Luke)");
  28. print("--------------------------------------\n");
  29. return 1;
  30. }
  31.  
  32.  
  33. public OnFilterScriptExit()
  34. {
  35. return 1;
  36. }
  37.  
  38. public OnGameModeInit()
  39. {
  40. CreatePickup(1318,1,2460.6772,-2120.8718,13.5530,0);
  41. Create3DTextLabel("Trucker Job Starting Position. /work to begin.", COLOR_RED, 2460.6772,-2120.8718,13.5530, 40.0, 0, 0);
  42. AddStaticVehicleEx(498,2484.60009766,-2117.19995117,13.80000019,0.00000000,-1,-1,15); //Boxville
  43. AddStaticVehicleEx(498,2508.60009766,-2116.19995117,13.80000019,0.00000000,-1,-1,15); //Boxville
  44. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  45. return 1;
  46. }
  47. // You can easily change the color of the Text Label. Just edit "COLOR_RED" to whatever suites you best.
  48. //You can also add more vehicles, feel free to map more Boxvilles. (ID 408)
  49.  
  50. public OnPlayerRequestClass(playerid, classid)
  51. {
  52. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  53. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  54. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  55. return 1;
  56. }
  57.  
  58. public OnPlayerConnect(playerid)
  59. {
  60. return 1;
  61. }
  62.  
  63. public OnPlayerDisconnect(playerid, reason)
  64. {
  65. return 1;
  66. }
  67.  
  68. public OnPlayerSpawn(playerid)
  69. {
  70. return 1;
  71. }
  72.  
  73. public OnPlayerDeath(playerid, killerid, reason)
  74. {
  75. return 1;
  76. }
  77.  
  78. public OnVehicleSpawn(vehicleid)
  79. {
  80. return 1;
  81. }
  82.  
  83. public OnVehicleDeath(vehicleid, killerid)
  84. {
  85. return 1;
  86. }
  87.  
  88. public OnPlayerText(playerid, text[])
  89. {
  90. return 1;
  91. }
  92.  
  93. public OnPlayerCommandText(playerid, cmdtext[])
  94. {
  95. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  96. {
  97. // Do something here
  98. return 1;
  99. }
  100. return 0;
  101. }
  102.  
  103. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  104. {
  105. return 1;
  106. }
  107.  
  108. public OnPlayerExitVehicle(playerid, vehicleid)
  109. {
  110. return 1;
  111. }
  112.  
  113. public OnPlayerStateChange(playerid, newstate, oldstate)
  114. {
  115. return 1;
  116. }
  117.  
  118. public OnPlayerEnterCheckpoint(playerid)
  119. {
  120. if(atcp[playerid] == 1)
  121. {
  122. atcp[playerid] = 2;
  123. TogglePlayerControllable(playerid, 0);
  124. SendClientMessage(playerid, COLOR_LIGHTCYAN, "Unloading, please wait...");
  125. SetTimerEx("cp1unload", 5000, false, "i", playerid);
  126. return 1;
  127. }
  128. if(atcp[playerid] == 2)
  129. {
  130. atcp[playerid] = 3;
  131. TogglePlayerControllable(playerid, 0);
  132. SendClientMessage(playerid, COLOR_LIGHTCYAN, "Unloading, please wait...");
  133. SetTimerEx("cp2unload", 5000, false, "i", playerid);
  134. return 1;
  135. }
  136. if(atcp[playerid] == 3)
  137. {
  138. atcp[playerid] = 4;
  139. TogglePlayerControllable(playerid, 0);
  140. SendClientMessage(playerid, COLOR_LIGHTCYAN, "Unloading, please wait...");
  141. SetTimerEx("cp3unload", 5000, false, "i", playerid);
  142. return 1;
  143. }
  144. if(atcp[playerid] == 4)
  145. {
  146. atcp[playerid] = 0;
  147. SendClientMessage(playerid, COLOR_LIGHTCYAN, "You have earned your money. Congratulations. +7500$");
  148. GivePlayerMoney(playerid, 7500);
  149. return 1;
  150. }
  151. return 1;
  152. }
  153.  
  154. forward cp1unload(playerid);
  155. public cp1unload(playerid)
  156. {
  157. TogglePlayerControllable(playerid, 1);
  158. SendClientMessage(playerid, COLOR_BLUEGREEN, "Unloading Complete. Proceed to the next checkpoint.");
  159. SetPlayerCheckpoint(playerid, cp2, 4.0);
  160. return 1;
  161. }
  162.  
  163. forward cp2unload(playerid);
  164. public cp2unload(playerid)
  165. {
  166. TogglePlayerControllable(playerid, 1);
  167. SendClientMessage(playerid, COLOR_BLUEGREEN, "Unloading Complete. Proceed to the next checkpoint.");
  168. SetPlayerCheckpoint(playerid, cp3, 4.0);
  169. return 1;
  170. }
  171.  
  172. forward cp3unload(playerid);
  173. public cp3unload(playerid)
  174. {
  175. TogglePlayerControllable(playerid, 1);
  176. SendClientMessage(playerid, COLOR_BLUEGREEN, "Unloading Complete. Proceed to the last checkpoint to retrieve your paycheck.");
  177. SetPlayerCheckpoint(playerid, startcp, 4.0);
  178. return 1;
  179. }
  180.  
  181. public OnPlayerLeaveCheckpoint(playerid)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerEnterRaceCheckpoint(playerid)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnPlayerLeaveRaceCheckpoint(playerid)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnRconCommand(cmd[])
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnPlayerRequestSpawn(playerid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnObjectMoved(objectid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnPlayerObjectMoved(playerid, objectid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnPlayerPickUpPickup(playerid, pickupid)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnVehicleMod(playerid, vehicleid, componentid)
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  227. {
  228. return 1;
  229. }
  230.  
  231. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  232. {
  233. return 1;
  234. }
  235.  
  236. public OnPlayerSelectedMenuRow(playerid, row)
  237. {
  238. return 1;
  239. }
  240.  
  241. public OnPlayerExitedMenu(playerid)
  242. {
  243. return 1;
  244. }
  245.  
  246. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  247. {
  248. return 1;
  249. }
  250.  
  251. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  252. {
  253. return 1;
  254. }
  255.  
  256. public OnRconLoginAttempt(ip[], password[], success)
  257. {
  258. return 1;
  259. }
  260.  
  261. public OnPlayerUpdate(playerid)
  262. {
  263. return 1;
  264. }
  265.  
  266. public OnPlayerStreamIn(playerid, forplayerid)
  267. {
  268. return 1;
  269. }
  270.  
  271. public OnPlayerStreamOut(playerid, forplayerid)
  272. {
  273. return 1;
  274. }
  275.  
  276. public OnVehicleStreamIn(vehicleid, forplayerid)
  277. {
  278. return 1;
  279. }
  280.  
  281. public OnVehicleStreamOut(vehicleid, forplayerid)
  282. {
  283. return 1;
  284. }
  285.  
  286. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  287. {
  288. return 1;
  289. }
  290.  
  291. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  292. {
  293. return 1;
  294. }
  295.  
  296. CMD:work(playerid, params[])
  297. {
  298. if(IsPlayerInRangeOfPoint(playerid, 4.0, startcp))
  299. {
  300. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498)
  301. {
  302. if(atcp[playerid] == 0)
  303. {
  304. atcp[playerid] = 1;
  305. SetPlayerCheckpoint(playerid, cp1, 4.0);
  306. SendClientMessage(playerid, COLOR_LIGHTCYAN, "Congratulations, you have started the job. Proceed to the checkpoints.");
  307. return 1;
  308. }
  309. }
  310. else SendClientMessage(playerid, COLOR_RED, "You're not in a Boxville. Please pick one up at the Trucker Job.");
  311. }
  312. else SendClientMessage(playerid, COLOR_RED, "You're not near the Truck Job.");
  313. return 1;
  314. }
  315.  
  316. CMD:tp(playerid, params[])
  317. {
  318. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Administrators only.");
  319. {
  320. SetPlayerPos(playerid, startcp);
  321. return 1;
  322. }
  323. }
  324.  
  325. //WILL BE UPDATED FREQUENTLY, STAY UPDATED ON THE FORUMS//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement