Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.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. #define DIALOG_CAMIONERO 1
  8. #define COLOR_YELLOW 0xFFFF00FF
  9. #define COLOR_WHITE 0xFFFFFFAA
  10.  
  11. new camion;
  12. new trabajoCamionero[256];
  13. #if defined FILTERSCRIPT
  14.  
  15. public OnFilterScriptInit()
  16. {
  17. print("\n--------------------------------------");
  18. print(" Blank Filterscript by your name here");
  19. print("--------------------------------------\n");
  20. return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25. return 1;
  26. }
  27.  
  28. #else
  29.  
  30. main()
  31. {
  32. print("\n----------------------------------");
  33. print(" Blank Gamemode by your name here");
  34. print("----------------------------------\n");
  35. }
  36.  
  37. #endif
  38.  
  39. public OnGameModeInit()
  40. {
  41. // Don't use these lines if it's a filterscript
  42. SetGameModeText("Blank Script");
  43. AddPlayerClass(0,1481.2692,-1739.7029,13.5469,1.4307,0,0,0,0,0,0);
  44. Create3DTextLabel("/trabajo camionero",COLOR_YELLOW, -1605.7200,62.8548,3.5547, 60.0, 0, 1);
  45. camion = AddStaticVehicleEx(578,-1623.9000000,74.4000000,4.3000000,228.0000000,254,254,15);
  46.  
  47. return 1;
  48. }
  49.  
  50. public OnGameModeExit()
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnPlayerRequestClass(playerid, classid)
  56. {
  57. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  58. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  59. return 1;
  60. }
  61.  
  62. public OnPlayerConnect(playerid)
  63. {
  64. return 1;
  65. }
  66.  
  67. public OnPlayerDisconnect(playerid, reason)
  68. {
  69. return 1;
  70. }
  71.  
  72. public OnPlayerSpawn(playerid)
  73. {
  74. return 1;
  75. }
  76.  
  77. public OnPlayerDeath(playerid, killerid, reason)
  78. {
  79. return 1;
  80. }
  81.  
  82. public OnVehicleSpawn(vehicleid)
  83. {
  84. return 1;
  85. }
  86.  
  87. public OnVehicleDeath(vehicleid, killerid)
  88. {
  89. return 1;
  90. }
  91.  
  92. public OnPlayerText(playerid, text[])
  93. {
  94. return 1;
  95. }
  96.  
  97. public OnPlayerCommandText(playerid, cmdtext[])
  98. {
  99. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  100. {
  101. // Do something here
  102. return 1;
  103. }
  104.  
  105. if(strcmp("/camionero", cmdtext, true, 10) == 0)
  106. {
  107. SetPlayerPos(playerid,-1618.0344,52.0087,3.5547);
  108. return 1;
  109. }
  110.  
  111. if(strcmp("/cargar camion", cmdtext, true, 10) == 0)
  112. {
  113. if(trabajoCamionero[playerid] != 1)
  114. {
  115. SendClientMessage(playerid,COLOR_WHITE,"Aun no no formas parte de la empresa {00ff19}camionero.");
  116. }
  117. else if(trabajoCamionero[playerid] == 1 && !IsPlayerInVehicle(playerid,camion))
  118. {
  119. SendClientMessage(playerid,COLOR_WHITE,"Actualmente no te encuentras en un camion de la empresa {00ff19}camionero.");
  120. }
  121.  
  122. if(trabajoCamionero[playerid] == 1 && IsPlayerInVehicle(playerid,camion))
  123. {
  124. SetPlayerCheckpoint(playerid,-1707.2401,56.2543,3.5547,10.0);
  125. }
  126.  
  127. return 1;
  128. }
  129.  
  130. if(strcmp("/trabajo camionero", cmdtext,true,10) == 0)
  131. {
  132. if(IsPlayerInRangeOfPoint(playerid,5,-1605.7200,62.8548,3.5547))
  133. {
  134. SendClientMessage(playerid,COLOR_WHITE, "{00ff19}Felicitaciones {FFFFFF}ya formas parte de la empresa camionero."); // color amarillo FFFF00FF
  135. trabajoCamionero[playerid] = 1;
  136. }
  137.  
  138. else
  139. {
  140. SendClientMessage(playerid, COLOR_WHITE, "{D51212}No te encuentras {FFFFFF}en el lugar designado para formar parte de camionero, utiliza {00ff19}/gps");
  141. }
  142. return 1;
  143. }
  144.  
  145. if(strcmp("/dejar trabajo camionero", cmdtext,true,10) == 0)
  146. {
  147. if(trabajoCamionero[playerid] == 1)
  148. {
  149. SendClientMessage(playerid, COLOR_WHITE,"{D51212}Haz abandonado {FFFFFF}el trabajo de camionero")
  150. trabajoCamionero[playerid] = 0;
  151. return 1;
  152. }
  153.  
  154. else
  155. {
  156. return 1;
  157. }
  158. }
  159. return 0;
  160. }
  161.  
  162. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  163. {
  164. return 1;
  165. }
  166.  
  167. public OnPlayerExitVehicle(playerid, vehicleid)
  168. {
  169. return 1;
  170. }
  171.  
  172. public OnPlayerStateChange(playerid, newstate, oldstate)
  173. {
  174. if(oldstate = PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  175. {
  176. if(IsPlayerInVehicle(playerid,camion))
  177. {
  178. SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Utilize {00ff19}/cargar camion {FFFFFF}para empezar a trabajar");
  179. }
  180. }
  181. return 1;
  182. }
  183.  
  184. public OnPlayerEnterCheckpoint(playerid)
  185. {
  186. if(IsPlayerInRangeOfPoint(playerid,10,-1707.2401,56.2543,3.5547) && IsPlayerInVehicle(playerid,camion))
  187. {
  188. ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST, "Camionero", "Ganar $1000\nGanar $2000", "Seleccionar", "Cerrar");
  189. DisablePlayerCheckpoint(playerid);
  190. }
  191.  
  192. if(IsPlayerInRangeOfPoint(playerid,10,-1618.0344,52.0087,3.5547) && IsPlayerInVehicle(playerid, camion))
  193. {
  194. GivePlayerMoney(playerid, 1000);
  195. SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Haz recibido {00ff19}$1000 {FFFFFF}por haber realizado tu entrega correctamente.");
  196. DisablePlayerCheckpoint(playerid);
  197. SetVehicleToRespawn(camion);
  198. }
  199.  
  200.  
  201. if(IsPlayerInRangeOfPoint(playerid,10,-1718.5625,34.2569,3.5547) && IsPlayerInVehicle(playerid, camion))
  202. {
  203. GivePlayerMoney(playerid, 2000);
  204. SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}Haz recibido {00ff19}$2000 {FFFFFF}por haber realizado tu entrega correctamente.");
  205. DisablePlayerCheckpoint(playerid);
  206. SetVehicleToRespawn(camion);
  207. }
  208.  
  209.  
  210. return 1;
  211. }
  212.  
  213. public OnPlayerLeaveCheckpoint(playerid)
  214. {
  215. return 1;
  216. }
  217.  
  218. public OnPlayerEnterRaceCheckpoint(playerid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnPlayerLeaveRaceCheckpoint(playerid)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnRconCommand(cmd[])
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnPlayerRequestSpawn(playerid)
  234. {
  235. return 1;
  236. }
  237.  
  238. public OnObjectMoved(objectid)
  239. {
  240. return 1;
  241. }
  242.  
  243. public OnPlayerObjectMoved(playerid, objectid)
  244. {
  245. return 1;
  246. }
  247.  
  248. public OnPlayerPickUpPickup(playerid, pickupid)
  249. {
  250. return 1;
  251. }
  252.  
  253. public OnVehicleMod(playerid, vehicleid, componentid)
  254. {
  255. return 1;
  256. }
  257.  
  258. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  259. {
  260. return 1;
  261. }
  262.  
  263. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  264. {
  265. return 1;
  266. }
  267.  
  268. public OnPlayerSelectedMenuRow(playerid, row)
  269. {
  270. return 1;
  271. }
  272.  
  273. public OnPlayerExitedMenu(playerid)
  274. {
  275. return 1;
  276. }
  277.  
  278. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  279. {
  280. return 1;
  281. }
  282.  
  283. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  284. {
  285. return 1;
  286. }
  287.  
  288. public OnRconLoginAttempt(ip[], password[], success)
  289. {
  290. return 1;
  291. }
  292.  
  293. public OnPlayerUpdate(playerid)
  294. {
  295. return 1;
  296. }
  297.  
  298. public OnPlayerStreamIn(playerid, forplayerid)
  299. {
  300. return 1;
  301. }
  302.  
  303. public OnPlayerStreamOut(playerid, forplayerid)
  304. {
  305. return 1;
  306. }
  307.  
  308. public OnVehicleStreamIn(vehicleid, forplayerid)
  309. {
  310. return 1;
  311. }
  312.  
  313. public OnVehicleStreamOut(vehicleid, forplayerid)
  314. {
  315. return 1;
  316. }
  317.  
  318. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  319. {
  320. if(dialogid == DIALOG_CAMIONERO)
  321. {
  322. if(response == 1)
  323. {
  324. switch(listitem)
  325. {
  326. case 0: SetPlayerCheckpoint(playerid,-1618.0344,52.0087,3.5547,10.0);
  327. case 1: SetPlayerCheckpoint(playerid,-1718.5625,34.2569,3.5547,10.0);
  328. }
  329. }
  330. return 1;
  331. }
  332.  
  333. return 0;
  334. }
  335.  
  336. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  337. {
  338. return 1;
  339. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement