Guest User

Fuel Deliverer v1.5 [UNIQUE] - UPDATE

a guest
Apr 4th, 2017
266
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. ______ _ ______ _ _ __ _____
  3. | ___| | | | _ \ | (_) / | | ___|
  4. | |_ _ _ ___| | | | | |___| |___ _____ _ __ ___ _ __ __ __`| | |___ \
  5. | _| | | |/ _ \ | | | | / _ \ | \ \ / / _ \ '__/ _ \ '__| \ \ / / | | \ \
  6. | | | |_| | __/ | | |/ / __/ | |\ V / __/ | | __/ | \ V / _| |__/\__/ /
  7. \_| \__,_|\___|_| |___/ \___|_|_| \_/ \___|_| \___|_| \_/ \___(_)____/
  8.  
  9.  
  10.  
  11.  
  12. | Fuel Deliverer Job [UNIQUE] |
  13.  
  14. | Script version 1.5 |
  15.  
  16. | Creators :- Bolex_ |
  17.  
  18. View/Download Links
  19.  
  20. | http://forum.sa-mp.com/showthread.php?p=3857049#post3857049 |
  21.  
  22.  
  23. */
  24. //----------------------------------------------------------------------------//
  25.  
  26. #define FILTERSCRIPT
  27.  
  28. #include <a_samp>
  29. #include <foreach>
  30. #include <izcmd>
  31.  
  32. #define PRESSED(%0) \
  33. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  34.  
  35. new Text3D:JOB_T, Text3D:LOADING_P, JobPick, LoadingPick, object;
  36.  
  37. new DELIVERER_VEHICLES[ 6 ], JOB_DELIVERER_VEHICLES[ MAX_VEHICLES ];
  38.  
  39. #define SCM SendClientMessage
  40. #define SPD ShowPlayerDialog
  41.  
  42. //-----//
  43. #define LOCATION ( 4 )
  44. #define DELIVERER_BONUS ( 25 )
  45. #define EARNINGS_BY_LOCATION ( 120 )
  46. #define DELIVERER_BR ( 9 )
  47. #define NEGATIVE_LOKACIJA ( 0 )
  48. #define DELIVERER_CP
  49. //-----//
  50.  
  51. enum
  52. {
  53. D_JHELP
  54. }
  55.  
  56. forward PJobInfo( playerid );
  57. forward HidePJobInfo( playerid );
  58.  
  59. //----------------------------------------------------------------------------//
  60.  
  61. new JobActive[ MAX_PLAYERS ], PlayerCP[ MAX_PLAYERS ], JobBonus[ MAX_PLAYERS ],
  62. JobEarnings[ MAX_PLAYERS ], PlayerEquipment[ MAX_PLAYERS ];
  63.  
  64. new Text:Info0, Text:Info1, Text:Info2, Text:Info3, Text:Info4, Text:Info5;
  65.  
  66. new Text:PosaoTD, Text:PosaoTD1, Text:PosaoTD2, Text:PosaoTD3,
  67. Text:PosaoTD4, Text:PosaoTD5, Text:PosaoTD6;
  68.  
  69. new PlayerText:DelivererInfo[ MAX_PLAYERS ], PlayerText:BarrelPrew[ MAX_PLAYERS ], PlayerText:BonusInfo[ MAX_PLAYERS ],
  70. PlayerText:TotalEarnInfo[ MAX_PLAYERS ], PlayerText:EarningsInfo[ MAX_PLAYERS ];
  71.  
  72. //----------------------------------------------------------------------------//
  73.  
  74. new Float:LOCATIONS[ DELIVERER_CP ][ 13 ] = {
  75.  
  76. {2143.4839,-2252.9707,13.3015,44.6907},
  77. {2197.8823,-1973.9418,13.5584,272.7168},
  78. {2447.8191,-1964.4468,13.5469,0.9570},
  79. {2066.1118,-1991.9330,13.5469,176.4049},
  80. {2494.0667,-1463.5614,24.0246,185.2177},
  81. {2446.4258,-1900.3201,13.5469,178.3327},
  82. {2157.1709,-1797.2056,13.3644,180.1486},
  83. {1220.4326,-1812.2965,16.5938,93.4171},
  84. {957.1688,-1556.5499,13.5781,270.0392},
  85. {2434.6362,-2124.5618,13.5469,183.1550},
  86. {1112.2283,-1182.9980,18.3215,355.4378},
  87. {747.9487,-1332.7919,13.5442,97.2721},
  88. {686.9423,-1569.7079,14.2422,3.5612}
  89.  
  90. };
  91.  
  92. //----------------------------------------------------------------------------//
  93.  
  94. #if defined FILTERSCRIPT
  95.  
  96. public OnFilterScriptInit( )
  97. {
  98. print("|--------------------------------------|");
  99. print(" Fuel Deliverer by Bolex_! ");
  100. print("|--------------------------------------|");
  101.  
  102. JobPick = CreatePickup( 1275, 2, 1902.5525,-1776.3734,13.5469, 0 );
  103. JOB_T = Create3DTextLabel( "{ADFF2F}[ Fuel Deliverer ]\n{ADFF2F}Contract: {FFFFFF}Steady\n{ADFF2F}In order to hire this job press {FFFFFF}Accept this job",-1,1902.5525,-1776.3734,13.5469,30.0,0,40 );
  104.  
  105. LoadingPick = CreatePickup( 3632, 1, 1938.2350,-1773.1140,13.3828, 0 );
  106. LOADING_P = Create3DTextLabel( "{ADFF2F}[ Fuel - Loading ]\n{ADFF2F}Number of loading: {FFFFFF}5\n{ADFF2F}For loading of the fuel enter{FFFFFF}[ /takefuel ]!",-1,1938.2350,-1773.1140,13.3828,30.0,0,1 );
  107.  
  108. DisableInteriorEnterExits( );
  109.  
  110. //------------------------------------------------------------------------//
  111. CreateObject(638, 1927.84741, -1767.55627, 13.22687, 0.00000, 0.00000, 180.00000);
  112. CreateObject(638, 1926.12695, -1766.56580, 13.22687, 0.00000, 0.00000, -90.20003);
  113. CreateObject(638, 1923.45703, -1766.55652, 13.22687, 0.00000, 0.00000, -90.20003);
  114. CreateObject(638, 1920.78687, -1766.54724, 13.22687, 0.00000, 0.00000, -90.20003);
  115. CreateObject(638, 1918.11621, -1766.53796, 13.22687, 0.00000, 0.00000, -90.20003);
  116. CreateObject(638, 1915.76599, -1766.52942, 13.21687, 0.00000, 0.00000, -90.20003);
  117. CreateObject(638, 1927.84741, -1770.22717, 13.22687, 0.00000, 0.00000, 180.00000);
  118. CreateObject(638, 1927.84741, -1772.89832, 13.22687, 0.00000, 0.00000, 180.00000);
  119. CreateObject(638, 1927.84741, -1775.55896, 13.22687, 0.00000, 0.00000, 180.00000);
  120. CreateObject(638, 1927.84741, -1778.23889, 13.22687, 0.00000, 0.00000, 180.00000);
  121. CreateObject(638, 1927.84741, -1780.91919, 13.22687, 0.00000, 0.00000, 180.00000);
  122. CreateObject(638, 1927.84741, -1783.59998, 13.22687, 0.00000, 0.00000, 180.00000);
  123. CreateObject(638, 1927.84741, -1785.07043, 13.21687, 0.00000, 0.00000, 180.00000);
  124. CreateObject(638, 1926.14954, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  125. CreateObject(638, 1923.47974, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  126. CreateObject(638, 1920.81982, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  127. CreateObject(638, 1918.15869, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  128. CreateObject(638, 1915.70862, -1786.07776, 13.21687, 0.00000, 0.00000, 90.00000);
  129. CreateObject(3657, 1923.41235, -1767.50598, 12.98687, 0.00000, 0.00000, 0.00000);
  130. CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
  131. CreateObject(3657, 1917.75244, -1785.18591, 12.98687, 0.00000, 0.00000, 180.00000);
  132. CreateObject(3657, 1923.41235, -1785.18652, 12.98687, 0.00000, 0.00000, 180.00000);
  133. CreateObject(3515, 1920.14966, -1776.90234, 11.97686, 0.00000, 0.00000, 0.00000);
  134. CreateObject(19304, 1920.01746, -1774.35498, 12.86280, 0.00000, 0.00000, 1.10000);
  135. CreateObject(19304, 1920.01953, -1779.44495, 12.86280, 0.00000, 0.00000, 1.90000);
  136. CreateObject(19304, 1917.40759, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
  137. CreateObject(19304, 1922.56641, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
  138. CreateObject(3657, 1917.75244, -1767.48584, 12.98687, 0.00000, 0.00000, 0.00000);
  139. CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
  140. CreateObject(3657, 1920.09326, -1773.73816, 12.98687, 0.00000, 0.00000, -179.19998);
  141. CreateObject(3657, 1923.09241, -1776.80762, 12.98687, 0.00000, 0.00000, 90.00000);
  142. CreateObject(3657, 1916.82324, -1776.89807, 12.98687, 0.00000, 0.00000, -89.89999);
  143. CreateObject(628, 1917.47778, -1774.25671, 14.48688, 0.00000, 0.00000, 130.69997);
  144. CreateObject(628, 1922.73438, -1773.92786, 14.48688, 0.00000, 0.00000, 41.29998);
  145. CreateObject(628, 1922.81885, -1779.53015, 14.48688, 0.00000, 0.00000, -18.70002);
  146. CreateObject(628, 1917.30359, -1779.75232, 14.48688, 0.00000, 0.00000, -136.50002);
  147. CreateObject(1536, 1900.93530, -1777.19812, 12.54690, 0.00000, 0.00000, 90.00000);
  148. CreateObject(1676, 1940.22900, -1776.39075, 13.89281, 0.00000, 0.00000, 90.00000);
  149. CreateObject(1676, 1940.22900, -1769.32007, 13.89281, 0.00000, 0.00000, 90.00000);
  150. CreateObject(19304, 1941.04785, -1776.01440, 12.55280, 0.00000, 0.00000, 90.00000);
  151. CreateObject(19304, 1941.04785, -1772.53418, 12.55280, 0.00000, 0.00000, 90.00000);
  152. CreateObject(19304, 1941.04785, -1769.83276, 12.55280, 0.00000, 0.00000, 90.00000);
  153. CreateObject(19304, 1939.49731, -1769.90393, 12.55280, 0.00000, 0.00000, 90.00000);
  154. CreateObject(19304, 1939.49731, -1773.37402, 12.55280, 0.00000, 0.00000, 90.00000);
  155. CreateObject(19304, 1939.49731, -1775.89490, 12.55280, 0.00000, 0.00000, 90.00000);
  156. CreateObject(1361, 1940.23840, -1778.36450, 12.87686, 0.00000, 0.00000, 0.00000);
  157. CreateObject(1361, 1940.23840, -1767.62451, 12.87686, 0.00000, 0.00000, 0.00000);
  158. CreateObject(6958, 1940.49646, -1773.03503, 20.91687, 0.00000, 0.00000, 0.00000);
  159. CreateObject(11417, 1940.28088, -1772.99634, 17.11281, 0.00000, 0.00000, -45.10001);
  160. CreateObject(1412, 1900.86987, -1762.39783, 13.79230, 0.00000, 0.00000, 0.51010);
  161. CreateObject(1412, 1906.14221, -1762.34680, 13.79230, 0.00000, 0.00000, 0.51010);
  162. CreateObject(1412, 1917.06885, -1762.26270, 13.79230, 0.00000, 0.00000, 0.51010);
  163. CreateObject(1412, 1922.60889, -1762.23621, 13.79230, 0.00000, 0.00000, 0.51010);
  164. CreateObject(1412, 1928.15308, -1762.18884, 13.79230, 0.00000, 0.00000, 0.51010);
  165. CreateObject(3633, 1902.44336, -1764.61243, 13.98450, 0.00000, 0.00000, 0.00000);
  166. CreateObject(3633, 1902.44336, -1764.61243, 13.02890, 0.00000, 0.00000, 0.00000);
  167. CreateObject(3632, 1941.77197, -1778.65820, 12.84090, 0.00000, 0.00000, 0.00000);
  168. CreateObject(3632, 1941.31543, -1779.30273, 12.84090, 0.00000, 0.00000, 0.00000);
  169. CreateObject(925, 1901.77673, -1785.73425, 13.57390, 0.00000, 0.00000, 90.01359);
  170. CreateObject(925, 1901.88110, -1789.45569, 13.57390, 0.00000, 0.00000, 90.01359);
  171. CreateObject(1222, 1902.19812, -1780.19250, 12.98960, 0.00000, 0.00000, 0.00000);
  172. CreateObject(1222, 1903.16638, -1780.45349, 12.98960, 0.00000, 0.00000, 0.00000);
  173. CreateObject(1222, 1902.83459, -1779.60364, 12.98960, 0.00000, 0.00000, 0.00000);
  174. //------------------------------------------------------------------------//
  175.  
  176. JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 0 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 1 ] ]= 0;
  177. JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 2 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 3 ] ]= 0;
  178. JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 4 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 5 ] ]= 0;
  179.  
  180. DELIVERER_VEHICLES[ 0 ] = CreateVehicle(578,1914.7301,-1793.1829,13.5069,330.3089,3,3,60000,0);
  181. DELIVERER_VEHICLES[ 1 ] = CreateVehicle(578,1918.4766,-1794.1277,13.5067,329.4436,3,3,60000,0);
  182. DELIVERER_VEHICLES[ 2 ] = CreateVehicle(578,1922.5284,-1794.1038,13.5070,329.2636,3,3,60000,0);
  183. DELIVERER_VEHICLES[ 3 ] = CreateVehicle(578,1926.5687,-1794.2007,13.5078,330.4030,3,3,60000,0);
  184. DELIVERER_VEHICLES[ 4 ] = CreateVehicle(578,1933.0986,-1784.5759,13.5075,0.5458,3,3,60000,0);
  185. DELIVERER_VEHICLES[ 5 ] = CreateVehicle(578,1932.8470,-1770.1198,13.5072,180.5444,3,3,60000,0);
  186.  
  187. //------------------------------------------------------------------------//
  188. PosaoTD = TextDrawCreate(119.500000, 165.125000, "usebox");
  189. TextDrawLetterSize(PosaoTD, 0.000000, 15.044445);
  190. TextDrawTextSize(PosaoTD, 34.500000, 0.000000);
  191. TextDrawAlignment(PosaoTD, 1);
  192. TextDrawColor(PosaoTD, 0);
  193. TextDrawUseBox(PosaoTD, true);
  194. TextDrawBoxColor(PosaoTD, 102);
  195. TextDrawSetShadow(PosaoTD, 0);
  196. TextDrawSetOutline(PosaoTD, 0);
  197. TextDrawFont(PosaoTD, 0);
  198.  
  199. PosaoTD1 = TextDrawCreate(41.000000, 168.187500, "usebox");
  200. TextDrawLetterSize(PosaoTD1, 0.000000, 14.262499);
  201. TextDrawTextSize(PosaoTD1, 112.500000, 0.000000);
  202. TextDrawAlignment(PosaoTD1, 1);
  203. TextDrawColor(PosaoTD1, 0);
  204. TextDrawUseBox(PosaoTD1, true);
  205. TextDrawBoxColor(PosaoTD1, 255);
  206. TextDrawSetShadow(PosaoTD1, 0);
  207. TextDrawSetOutline(PosaoTD1, 0);
  208. TextDrawFont(PosaoTD1, 0);
  209.  
  210. PosaoTD2 = TextDrawCreate(47.000000, 170.187500, "FUEL DELIVERER");
  211. TextDrawLetterSize(PosaoTD2, 0.132500, 0.738125);
  212. TextDrawAlignment(PosaoTD2, 1);
  213. TextDrawColor(PosaoTD2, -1);
  214. TextDrawSetShadow(PosaoTD2, 0);
  215. TextDrawSetOutline(PosaoTD2, 1);
  216. TextDrawBackgroundColor(PosaoTD2, 51);
  217. TextDrawFont(PosaoTD2, 2);
  218. TextDrawSetProportional(PosaoTD2, 1);
  219.  
  220. PosaoTD3 = TextDrawCreate(43.000000, 175.875000, "-------------------------");
  221. TextDrawLetterSize(PosaoTD3, 0.204500, 0.790626);
  222. TextDrawAlignment(PosaoTD3, 1);
  223. TextDrawColor(PosaoTD3, -5963521);
  224. TextDrawUseBox(PosaoTD3, true);
  225. TextDrawBoxColor(PosaoTD3, 0);
  226. TextDrawSetShadow(PosaoTD3, 0);
  227. TextDrawSetOutline(PosaoTD3, 1);
  228. TextDrawBackgroundColor(PosaoTD3, 51);
  229. TextDrawFont(PosaoTD3, 2);
  230. TextDrawSetProportional(PosaoTD3, 1);
  231.  
  232. PosaoTD4 = TextDrawCreate(50.000000, 197.750000, "ACCEPT THIS JOB");
  233. TextDrawLetterSize(PosaoTD4, 0.148499, 0.777500);
  234. TextDrawAlignment(PosaoTD4, 1);
  235. TextDrawColor(PosaoTD4, -1);
  236. TextDrawSetShadow(PosaoTD4, 0);
  237. TextDrawSetOutline(PosaoTD4, 1);
  238. TextDrawBackgroundColor(PosaoTD4, 51);
  239. TextDrawFont(PosaoTD4, 2);
  240. TextDrawSetProportional(PosaoTD4, 1);
  241. TextDrawSetSelectable(PosaoTD4, true);
  242.  
  243. PosaoTD5 = TextDrawCreate(59.000000, 217.437500, "REFUSE IT");
  244. TextDrawLetterSize(PosaoTD5, 0.147499, 0.786250);
  245. TextDrawAlignment(PosaoTD5, 1);
  246. TextDrawColor(PosaoTD5, -1);
  247. TextDrawSetShadow(PosaoTD5, 0);
  248. TextDrawSetOutline(PosaoTD5, 1);
  249. TextDrawBackgroundColor(PosaoTD5, 51);
  250. TextDrawFont(PosaoTD5, 2);
  251. TextDrawSetProportional(PosaoTD5, 1);
  252. TextDrawSetSelectable(PosaoTD5, true);
  253.  
  254. PosaoTD6 = TextDrawCreate(43.000000, 249.812500, "EARNS:~y~PER LOCATION + BONUS");
  255. TextDrawLetterSize(PosaoTD6, 0.104500, 0.580626);
  256. TextDrawAlignment(PosaoTD6, 1);
  257. TextDrawColor(PosaoTD6, -1);
  258. TextDrawSetShadow(PosaoTD6, 0);
  259. TextDrawSetOutline(PosaoTD6, 1);
  260. TextDrawBackgroundColor(PosaoTD6, 51);
  261. TextDrawFont(PosaoTD6, 2);
  262. TextDrawSetProportional(PosaoTD6, 1);
  263. //------------------------------------------------------------------------//
  264. return 1;
  265. }
  266.  
  267. //----------------------------------------------------------------------------//
  268.  
  269. public OnFilterScriptExit( )
  270. {
  271. print("|--------------------------------------|");
  272. print(" Fuel Deliverer by Bolex_! Closed!");
  273. print("|--------------------------------------|");
  274.  
  275. Delete3DTextLabel(JOB_T); Delete3DTextLabel(LOADING_P);
  276. DestroyPickup(JobPick); DestroyPickup(LoadingPick);
  277. DestroyVehicle(JOB_DELIVERER_VEHICLES[ 0 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 1 ]);
  278. DestroyVehicle(JOB_DELIVERER_VEHICLES[ 2 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 3 ]);
  279. DestroyVehicle(JOB_DELIVERER_VEHICLES[ 4 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 5 ]);
  280. return 1;
  281. }
  282.  
  283. //----------------------------------------------------------------------------//
  284.  
  285. PreloadAnimLib(playerid, animlib[])
  286. {
  287. ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  288. }
  289. public OnPlayerConnect( playerid )
  290. {
  291. PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"DEALER");
  292. JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0;
  293. PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
  294.  
  295. //---//
  296. RemoveBuildingForPlayer(playerid, 5535, 1918.8516, -1776.3281, 16.9766, 0.25);
  297. RemoveBuildingForPlayer(playerid, 1524, 1910.1641, -1779.6641, 18.7500, 0.25);
  298. RemoveBuildingForPlayer(playerid, 5681, 1921.4844, -1778.9141, 18.5781, 0.25);
  299. RemoveBuildingForPlayer(playerid, 5409, 1918.8516, -1776.3281, 16.9766, 0.25);
  300. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1778.4531, 14.1406, 0.25);
  301. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1774.3125, 14.1406, 0.25);
  302. RemoveBuildingForPlayer(playerid, 955, 1928.7344, -1772.4453, 12.9453, 0.25);
  303. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1771.3438, 14.1406, 0.25);
  304. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1767.2891, 14.1406, 0.25);
  305. RemoveBuildingForPlayer(playerid, 1226, 1955.6641, -1793.0938, 16.3906, 0.25);
  306. //---//
  307. return 1;
  308. }
  309.  
  310. public OnPlayerDisconnect(playerid, reason)
  311. {
  312. JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0; HidePJobInfo( playerid );
  313. PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
  314. return 1;
  315. }
  316.  
  317. public OnPlayerDeath(playerid, killerid, reason)
  318. {
  319. if(JobActive[ playerid ] == 1)
  320. {
  321. JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0;
  322. PlayerCP[ playerid ] =NEGATIVE_LOKACIJA;
  323. DisablePlayerCheckpoint( playerid );
  324. HidePJobInfo( playerid );
  325. SCM(playerid, 0x48977996,"[JOB]: {FFFFFF}You left the vehicle and the job is done!");
  326. }
  327. return 1;
  328. }
  329. CMD:takefuel(playerid, params[])
  330. {
  331. if(JobActive[ playerid ] == 1)
  332. {
  333. if(IsPlayerInRangeOfPoint(playerid,3.0, 1938.2350,-1773.1140,13.3828))
  334. {
  335. if(GetPlayerState( playerid ) == PLAYER_STATE_DRIVER)
  336. {
  337. if(JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )] == 0)
  338. {
  339. new string[56];
  340. JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]=5;
  341. SCM(playerid, 0x48977996,"[FUEL]: {FFFFFF}Fuel gas been loaded, submit it to the location on the map!");
  342. object = CreateObject( 2935,0,0,0,0,0,0,80 );
  343. AttachObjectToVehicle( object, GetPlayerVehicleID(playerid), 0.000000, -1.300000, 1.200000, 0.000000, 0.000000, 0.000000 );
  344.  
  345. PlayerTextDrawHide(playerid,DelivererInfo[ playerid ]);
  346. format(string,sizeof(string),"TO DELIVERED: ~y~%d/5",JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]);
  347. PlayerTextDrawSetString(playerid,DelivererInfo[ playerid ],string);
  348. PlayerTextDrawShow(playerid,DelivererInfo[ playerid ]);
  349. }
  350. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}the vehicle got another fuel they have to be deliver!");
  351. }
  352. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You must be in vehicle!");
  353. }
  354. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You're not with the vehicle in place for taking fuel!");
  355. }
  356. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You dont do any kind of job!");
  357. return 1;
  358. }
  359. CMD:endjob(playerid, params[])
  360. {
  361. if(JobActive[ playerid ] == 1)
  362. {
  363. new string[128];
  364. GivePlayerMoney(playerid,JobEarnings[ playerid ]+JobBonus[ playerid ]);
  365. format(string,sizeof(string),"[INFO]: {FFFFFF}You earned %d$ after job completion!",JobEarnings[ playerid ]+JobBonus[ playerid ]);
  366. SCM(playerid,0x48977996,string);
  367. JobEarnings[ playerid ] =0; JobBonus[ playerid ] =0; JobActive[ playerid ] =0; PlayerEquipment[ playerid ] =0;
  368. if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR)) { RemovePlayerAttachedObject(playerid, DELIVERER_BR); }
  369. PlayerCP[ playerid ]= NEGATIVE_LOKACIJA;
  370. HidePJobInfo( playerid );
  371. JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]=0;
  372. SetVehicleToRespawn(GetPlayerVehicleID( playerid ));
  373. RemovePlayerFromVehicle( playerid );
  374. SetPlayerSkin(playerid,PlayerEquipment[ playerid ]);
  375. DisablePlayerCheckpoint( playerid );
  376. DestroyObject(object);
  377.  
  378. }
  379. else SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You are not employed as the delivery of fuel!");
  380. return 1;
  381. }
  382. CMD:takef(playerid, params[])
  383. {
  384. if(JobActive[ playerid ] == 1)
  385. {
  386. if(!IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
  387. {
  388. if(GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT)
  389. {
  390. new Float:X,Float:Y,Float:Z;
  391. for( new j=0;j<6;j++ )
  392. {
  393. GetVehiclePos( DELIVERER_VEHICLES[j],X,Y,Z );
  394. if(IsPlayerInRangeOfPoint( playerid,3.0,X,Y,Z ))
  395. {
  396. if(JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[j]] >= 1)
  397. {
  398. JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[j]]--;
  399. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  400. SetPlayerAttachedObject( playerid, DELIVERER_BR, 3632, 1, 0.002953, 0.469660, -0.009797, 269.851104, 88.443557, 0.000000, 0.804894, 1.000000, 0.822361 );
  401. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Deliver a fuel on the red marker!");
  402. return 1;
  403. }
  404. else
  405. {
  406. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You have no more fuel, take new one!");
  407. return 1;
  408. }
  409. }
  410. }
  411. }
  412. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You need to get out of the vehicle!");
  413. }
  414. else return SCM(playerid,-1," {E10000}(Info): {FFFFFF}You've already got one bottle of fuel!");
  415. }
  416. return 1;
  417. }
  418. CMD:test(playerid, params[])
  419. {
  420. SetPlayerPos(playerid, 1935.1696,-1794.7130,13.5469); //Teleportation to the job, remove it
  421. return 1;
  422. }
  423. public PJobInfo( playerid )
  424. {
  425. new string[56];
  426. format(string,sizeof(string),"TO DELIVERED: ~y~%d/5",JOB_DELIVERER_VEHICLES[GetPlayerVehicleID(playerid)]);
  427. DelivererInfo[ playerid ] = CreatePlayerTextDraw(playerid,524.500000, 125.562500, string);
  428. PlayerTextDrawBackgroundColor(playerid,DelivererInfo[ playerid ], 51);
  429. PlayerTextDrawFont(playerid,DelivererInfo[ playerid ], 2);
  430. PlayerTextDrawLetterSize(playerid,DelivererInfo[ playerid ], 0.155000, 0.716250);
  431. PlayerTextDrawColor(playerid,DelivererInfo[ playerid ], -1);
  432. PlayerTextDrawSetOutline(playerid,DelivererInfo[ playerid ], 1);
  433. PlayerTextDrawSetProportional(playerid,DelivererInfo[ playerid ], 1);
  434. PlayerTextDrawSetSelectable(playerid,DelivererInfo[ playerid ], 0);
  435.  
  436. BarrelPrew[ playerid ] = CreatePlayerTextDraw(playerid,497.500000, 140.000000, " ");
  437. PlayerTextDrawFont(playerid,BarrelPrew[ playerid ], 5);
  438. PlayerTextDrawLetterSize(playerid,BarrelPrew[ playerid ], 0.449999, 1.600000);
  439. PlayerTextDrawColor(playerid,BarrelPrew[ playerid ], -1);
  440. PlayerTextDrawSetOutline(playerid,BarrelPrew[ playerid ], 0);
  441. PlayerTextDrawSetProportional(playerid,BarrelPrew[ playerid ], 1);
  442. PlayerTextDrawSetShadow(playerid,BarrelPrew[ playerid ], 0);
  443. PlayerTextDrawBackgroundColor(playerid,BarrelPrew[ playerid ], 0x00000000);
  444. PlayerTextDrawBoxColor(playerid,BarrelPrew[ playerid ], 45312);
  445. PlayerTextDrawTextSize(playerid,BarrelPrew[ playerid ], 28.500000, -21.437500);
  446. PlayerTextDrawSetSelectable(playerid,BarrelPrew[ playerid ], 0);
  447. PlayerTextDrawSetPreviewModel(playerid,BarrelPrew[ playerid ],3632);
  448. PlayerTextDrawSetPreviewRot(playerid,BarrelPrew[ playerid ],216.000000, 0.000000, 0.000000, 1.000000);
  449.  
  450. format(string,sizeof(string),"EARNINGS: ~y~%d~g~$",JobEarnings[ playerid ]);
  451. EarningsInfo[ playerid ] = CreatePlayerTextDraw(playerid,527.000000, 139.125000, string);
  452. PlayerTextDrawBackgroundColor(playerid,EarningsInfo[ playerid ], 51);
  453. PlayerTextDrawFont(playerid,EarningsInfo[ playerid ], 2);
  454. PlayerTextDrawLetterSize(playerid,EarningsInfo[ playerid ], 0.154500, 0.589376);
  455. PlayerTextDrawColor(playerid,EarningsInfo[ playerid ], -1);
  456. PlayerTextDrawSetOutline(playerid,EarningsInfo[ playerid ], 1);
  457. PlayerTextDrawSetProportional(playerid,EarningsInfo[ playerid ], 1);
  458. PlayerTextDrawSetSelectable(playerid,EarningsInfo[ playerid ], 0);
  459.  
  460. format(string,sizeof(string),"BONUS: ~y~+%d~g~$",JobBonus[ playerid ]);
  461. BonusInfo[ playerid ] = CreatePlayerTextDraw(playerid,533.000000, 145.250000, string);
  462. PlayerTextDrawBackgroundColor(playerid,BonusInfo[ playerid ], 51);
  463. PlayerTextDrawFont(playerid,BonusInfo[ playerid ], 2);
  464. PlayerTextDrawLetterSize(playerid,BonusInfo[ playerid ], 0.150000, 0.589375);
  465. PlayerTextDrawColor(playerid,BonusInfo[ playerid ], -1);
  466. PlayerTextDrawSetOutline(playerid,BonusInfo[ playerid ], 1);
  467. PlayerTextDrawSetProportional(playerid,BonusInfo[ playerid ], 1);
  468. PlayerTextDrawSetSelectable(playerid,BonusInfo[ playerid ], 0);
  469.  
  470. format(string,sizeof(string),"TOTAL EARN: ~y~%d~g~$",JobEarnings[ playerid ]+JobBonus[ playerid ]);
  471. TotalEarnInfo[ playerid ] = CreatePlayerTextDraw(playerid,554.500000, 166.687500, string);
  472. PlayerTextDrawBackgroundColor(playerid,TotalEarnInfo[ playerid ], 51);
  473. PlayerTextDrawFont(playerid,TotalEarnInfo[ playerid ], 1);
  474. PlayerTextDrawLetterSize(playerid,TotalEarnInfo[ playerid ], 0.140000, 0.698750);
  475. PlayerTextDrawColor(playerid,TotalEarnInfo[ playerid ], -1);
  476. PlayerTextDrawSetOutline(playerid,TotalEarnInfo[ playerid ], 1);
  477. PlayerTextDrawSetProportional(playerid,TotalEarnInfo[ playerid ], 1);
  478. PlayerTextDrawSetSelectable(playerid,TotalEarnInfo[ playerid ], 0);
  479. PlayerTextDrawAlignment(playerid,TotalEarnInfo[ playerid ], 2);
  480.  
  481. Info0 = TextDrawCreate(495.500000, 116.125000, "usebox");
  482. TextDrawLetterSize(Info0, 0.000000, 6.780555);
  483. TextDrawTextSize(Info0, 615.000000, 0.000000);
  484. TextDrawAlignment(Info0, 1);
  485. TextDrawColor(Info0, 0);
  486. TextDrawUseBox(Info0, true);
  487. TextDrawBoxColor(Info0, 102);
  488. TextDrawSetShadow(Info0, 0);
  489. TextDrawSetOutline(Info0, 0);
  490. TextDrawFont(Info0, 0);
  491.  
  492. Info1 = TextDrawCreate(496.000000, 103.875000, "usebox");
  493. TextDrawLetterSize(Info1, 0.000000, 0.995833);
  494. TextDrawTextSize(Info1, 614.500000, 0.000000);
  495. TextDrawAlignment(Info1, 1);
  496. TextDrawColor(Info1, 0);
  497. TextDrawUseBox(Info1, true);
  498. TextDrawBoxColor(Info1, 102);
  499. TextDrawSetShadow(Info1, 0);
  500. TextDrawSetOutline(Info1, 0);
  501. TextDrawFont(Info1, 0);
  502.  
  503. Info2 = TextDrawCreate(616.000000, 114.187500, "LD_SPAC:white");
  504. TextDrawLetterSize(Info2, 0.000000, 0.000000);
  505. TextDrawTextSize(Info2, -121.500000, 0.437500);
  506. TextDrawAlignment(Info2, 1);
  507. TextDrawColor(Info2, -5963521);
  508. TextDrawSetShadow(Info2, 0);
  509. TextDrawSetOutline(Info2, 0);
  510. TextDrawBackgroundColor(Info2, -5963521);
  511. TextDrawFont(Info2, 4);
  512.  
  513. Info3 = TextDrawCreate(510.000000, 103.687500, "INFO - FUEL DELIVERER");
  514. TextDrawLetterSize(Info3, 0.212500, 0.926251);
  515. TextDrawAlignment(Info3, 1);
  516. TextDrawColor(Info3, -1);
  517. TextDrawSetShadow(Info3, 0);
  518. TextDrawSetOutline(Info3, 1);
  519. TextDrawBackgroundColor(Info3, 51);
  520. TextDrawFont(Info3, 2);
  521. TextDrawSetProportional(Info3, 1);
  522.  
  523. Info4 = TextDrawCreate(523.500000, 172.375000, "IIIIIIIIIIIIIIIIIIIIIIIII");
  524. TextDrawLetterSize(Info4, 0.187999, 0.768750);
  525. TextDrawAlignment(Info4, 1);
  526. TextDrawColor(Info4, -5963521);
  527. TextDrawUseBox(Info4, true);
  528. TextDrawBoxColor(Info4, 0);
  529. TextDrawSetShadow(Info4, 0);
  530. TextDrawSetOutline(Info4, 1);
  531. TextDrawBackgroundColor(Info4, 51);
  532. TextDrawFont(Info4, 2);
  533. TextDrawSetProportional(Info4, 1);
  534.  
  535. Info5 = TextDrawCreate(575.000000, 122.937500, "New Textdraw");
  536. TextDrawLetterSize(Info5, 0.449999, 1.600000);
  537. TextDrawTextSize(Info5, 48.500000, 43.750000);
  538. TextDrawAlignment(Info5, 1);
  539. TextDrawColor(Info5, -1);
  540. TextDrawBoxColor(Info5, 0x00000000);
  541. TextDrawBackgroundColor(Info5, 0x00000000);
  542. TextDrawSetShadow(Info5, 0);
  543. TextDrawSetOutline(Info5, 1);
  544. TextDrawFont(Info5, 5);
  545. TextDrawSetProportional(Info5, 1);
  546. TextDrawSetPreviewModel(Info5, 578);
  547. TextDrawSetPreviewRot(Info5, 1.000000, 1.000000, 315.000000, 1.000000);
  548.  
  549. TextDrawShowForPlayer(playerid, Info0); TextDrawShowForPlayer(playerid, Info1);
  550. TextDrawShowForPlayer(playerid, Info2); TextDrawShowForPlayer(playerid, Info3);
  551. TextDrawShowForPlayer(playerid, Info4); TextDrawShowForPlayer(playerid, Info5);
  552.  
  553. PlayerTextDrawShow(playerid, DelivererInfo[ playerid ]);
  554. PlayerTextDrawShow(playerid, BarrelPrew[ playerid ]);
  555. PlayerTextDrawShow(playerid, EarningsInfo[ playerid ]);
  556. PlayerTextDrawShow(playerid, TotalEarnInfo[ playerid ]);
  557. PlayerTextDrawShow(playerid, BonusInfo[ playerid ]);
  558. return 1;
  559. }
  560.  
  561. public HidePJobInfo( playerid )
  562. {
  563. TextDrawHideForPlayer(playerid, Info0); TextDrawHideForPlayer(playerid, Info1); TextDrawHideForPlayer(playerid, Info2);
  564. TextDrawHideForPlayer(playerid, Info3); TextDrawHideForPlayer(playerid, Info4); TextDrawHideForPlayer(playerid, Info5);
  565.  
  566. PlayerTextDrawDestroy(playerid, DelivererInfo[ playerid ]);
  567. PlayerTextDrawDestroy(playerid, BarrelPrew[ playerid ]);
  568. PlayerTextDrawDestroy(playerid, EarningsInfo[ playerid ]);
  569. PlayerTextDrawDestroy(playerid, TotalEarnInfo[ playerid ]);
  570. PlayerTextDrawDestroy(playerid, BonusInfo[ playerid ]);
  571. return 1;
  572. }
  573. public OnPlayerStateChange(playerid, newstate, oldstate)
  574. {
  575. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  576. {
  577. if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
  578. {
  579. RemovePlayerFromVehicle( playerid );
  580. SetPlayerArmedWeapon( playerid, 0);
  581. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  582. }
  583. new VID = GetPlayerVehicleID( playerid );
  584. if(VID == DELIVERER_VEHICLES[ 0 ] || VID == DELIVERER_VEHICLES[ 1 ] || VID == DELIVERER_VEHICLES[ 2 ] || VID == DELIVERER_VEHICLES[ 3 ] || VID == DELIVERER_VEHICLES[ 4 ] || VID == DELIVERER_VEHICLES[ 5 ])
  585. {
  586. if(JobActive[ playerid ] == 1)
  587. {
  588. PJobInfo( playerid );
  589. if(PlayerCP[ playerid ] == NEGATIVE_LOKACIJA)
  590. {
  591. new rand = random(sizeof(LOCATIONS));
  592. new oprema = random(311)+1;
  593. if(oprema == 74) return oprema=75;
  594. SetPlayerCheckpoint(playerid, LOCATIONS[rand][ 0 ], LOCATIONS[rand][ 1 ], LOCATIONS[rand][ 2 ],2.0);
  595. PlayerCP[ playerid ] = LOCATION;
  596. }
  597. }
  598. else
  599. {
  600. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You are not employed as the delivery of fuel!");
  601. RemovePlayerFromVehicle( playerid );
  602. }
  603. }
  604. }
  605. else if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) { HidePJobInfo( playerid ); }
  606. return 1;
  607. }
  608. public OnPlayerEnterCheckpoint( playerid )
  609. {
  610. if(PlayerCP[ playerid ] == LOCATION)
  611. {
  612. if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
  613. {
  614. new string[128];
  615. new bon=random( DELIVERER_BONUS + 15 );
  616. JobBonus[ playerid ]+=bon;
  617. JobEarnings[ playerid ]+=EARNINGS_BY_LOCATION;
  618. format(string,sizeof(string),"[INFO]: {FFFFFF}You earned %d$ with bounus %d$ for delivered a bottle of fuel!", EARNINGS_BY_LOCATION, bon);
  619. SCM(playerid, 0x48977996,string);
  620. RemovePlayerAttachedObject(playerid, DELIVERER_BR);
  621. PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
  622. DisablePlayerCheckpoint( playerid );
  623. ClearAnimations( playerid );
  624. }
  625. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You need to take a bottle of fuel from the vehicle in order deliver at this location!");
  626. }
  627. return 1;
  628. }
  629. public OnPlayerPickUpPickup(playerid, pickupid)
  630. {
  631. if(pickupid == JobPick)
  632. {
  633. TextDrawShowForPlayer(playerid, PosaoTD); TextDrawShowForPlayer(playerid, PosaoTD1); TextDrawShowForPlayer(playerid, PosaoTD2); TextDrawShowForPlayer(playerid, PosaoTD3);
  634. TextDrawShowForPlayer(playerid, PosaoTD4); TextDrawShowForPlayer(playerid, PosaoTD5); TextDrawShowForPlayer(playerid, PosaoTD6);
  635.  
  636. SelectTextDraw(playerid, 0xA3B4C5FF);
  637. }
  638. return 1;
  639. }
  640. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  641. {
  642. if(_:clickedid != INVALID_TEXT_DRAW)
  643. {
  644. if(clickedid == PosaoTD4)
  645. {
  646. if(IsPlayerInRangeOfPoint(playerid,3.0, 1902.5525,-1776.3734,13.5469))
  647. {
  648. if(JobActive[ playerid ] == 0)
  649. {
  650. new string[235];
  651. format(string, sizeof(string),"{FF7E19}Congratulations! {FFFFFF}You've just got a job Fuel Deliverer!\n\nIn this job it is necessary to provide fuel at certain locations after loading\n{FF7E19}Job commands: {FFFFFF}/takef /takefuel /endjob");
  652. SPD(playerid, D_JHELP, DIALOG_STYLE_MSGBOX, "Fuel Deliverer Job", string, "Ok", "");
  653. SCM(playerid, -1,"{E10000}(Info): {FFFFFF}Get in you'r vehicle in order to continue with the job!");
  654. JobActive[ playerid ] = 1;
  655. PlayerEquipment[ playerid ] = GetPlayerSkin( playerid );
  656. SetPlayerSkin( playerid, 8 );
  657. }
  658. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You've already work as Fuel Deliverer!");
  659. }
  660. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You'r not in place for taking job!");
  661. }
  662. else if(clickedid == PosaoTD5)
  663. {
  664. TextDrawHideForPlayer(playerid, PosaoTD5);
  665. }
  666. TextDrawHideForPlayer(playerid, PosaoTD); TextDrawHideForPlayer(playerid, PosaoTD1); TextDrawHideForPlayer(playerid, PosaoTD2); TextDrawHideForPlayer(playerid, PosaoTD3);
  667. TextDrawHideForPlayer(playerid, PosaoTD4); TextDrawHideForPlayer(playerid, PosaoTD5); TextDrawHideForPlayer(playerid, PosaoTD6);
  668.  
  669. CancelSelectTextDraw( playerid );
  670. }
  671. return 1;
  672. }
  673. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  674. {
  675. if(PRESSED(KEY_FIRE))
  676. {
  677. if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
  678. {
  679. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  680. SetPlayerArmedWeapon( playerid, 0 );
  681. }
  682. }
  683. return 1;
  684. }
  685. #endif
RAW Paste Data