Advertisement
Guest User

[FS] | Posao Dostavljac Goriva v1.5 | ( foreach, izcmd )

a guest
Mar 3rd, 2017
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.77 KB | None | 0 0
  1. /*
  2. ______ _ _ _ _
  3. | _ \ | | | (_) (_)
  4. | | | |___ ___| |_ __ ___ _| |_ __ _ ___ __ _ ___ _ __ ___ ____ _
  5. | | | / _ \/ __| __/ _` \ \ / / | |/ _` |/ __| / _` |/ _ \| '__| \ \ / / _` |
  6. | |/ / (_) \__ \ || (_| |\ V /| | | (_| | (__ | (_| | (_) | | | |\ V / (_| |
  7. |___/ \___/|___/\__\__,_| \_/ |_| |\__,_|\___| \__, |\___/|_| |_| \_/ \__,_|
  8. _/ | __/ |
  9. |__/ |___/
  10.  
  11. | Posao Dostavljač Goriva [UNIKATAN] |
  12.  
  13. | Verzija skripte 1.5 |
  14.  
  15. | Izradio :- Bolex_ |
  16. LIG
  17.  
  18. Upute o korištenju:- Nakon što se zaposlite kao Dostavljac Goriva, prvo što će te napravite je da uđete u vozilo
  19. ovoga posla, te nakon toga morate da Utovarite teret(/utovar)! Nakon sto se to obavili morat ce te dostaviti ta goriva
  20. na svaku lokaciju prikazanoj na Mini Mapi!Nakon što dođete do određenog Crvenog Markera, morate izaći iz vozila i uzeti
  21. "Bocu" goriva(/uzmigas)i dostaviti je na Crveni marker kako bi dobili određenu sumu novaca + bonus ;) Isto tako nastavite
  22. sa dostavljanjem na drugim lokacijama!
  23. Nakon što se dostavi svih 5 boca sa gorivom morat će te da utovarite novi teret kako bi mogli nastaviti sa dostavom na
  24. druge lokacije.Ukoliko mislite da ste dovoljno zaradili i ukoliko zelite prekinuti posao (/prekiniposao) dobit će te onu
  25. sumu novaca koju ste zaradili sa bonusom!
  26.  
  27.  
  28. */
  29. //----------------------------------------------------------------------------//
  30.  
  31. #define FILTERSCRIPT
  32.  
  33. #include <a_samp>
  34. #include <foreach>
  35. #include <izcmd>
  36.  
  37. #define PRESSED(%0) \
  38. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  39.  
  40. new Text3D:POSAO_T, Text3D:UTOVAR_P;
  41. new PosaoPick, UtovarPick;
  42.  
  43. new DOSTAVLJAC_VOZILA[ 6 ], POSAO_DOSTAVLJAC_VOZILA[ MAX_VEHICLES ];
  44.  
  45. #define SCM SendClientMessage
  46. #define SPD ShowPlayerDialog
  47.  
  48. #define LOKACIJA ( 4 )
  49. #define DOSTAVLJAC_BONUS ( 50 )
  50. #define ZARADA_PO_LOKACIJI ( 100 )
  51. #define DOSTAVLJAC_BR ( 9 )
  52. #define NEGATIVNA_LOKACIJA ( 0 )
  53. #define DOSTAVLJAC_CP
  54.  
  55. forward ShowPlayerPosaoInfo( playerid );
  56. forward HidePlayerPosaoInfo( playerid );
  57.  
  58. enum
  59. {
  60. D_POMOC
  61. }
  62.  
  63. //----------------------------------------------------------------------------//
  64.  
  65. new AktivanPosao[ MAX_PLAYERS ], IgracCP[ MAX_PLAYERS ], PosaoBonus[ MAX_PLAYERS ],
  66. PosaoZarada[ MAX_PLAYERS ], IgracOprema[ MAX_PLAYERS ];
  67.  
  68. new Text:Info0, Text:Info1, Text:Info2, Text:Info3, Text:Info4, Text:Info5;
  69.  
  70. new Text:PosaoTD, Text:PosaoTD1, Text:PosaoTD2, Text:PosaoTD3,
  71. Text:PosaoTD4, Text:PosaoTD5, Text:PosaoTD6;
  72.  
  73. new PlayerText:DostavljacInfo[ MAX_PLAYERS ], PlayerText:BacvaPrew[ MAX_PLAYERS ], PlayerText:BonusInfo[ MAX_PLAYERS ],
  74. PlayerText:TotalZaradaInfo[ MAX_PLAYERS ], PlayerText:ZaradaInfo[ MAX_PLAYERS ];
  75.  
  76. //----------------------------------------------------------------------------//
  77.  
  78. new Float:LOKACIJE[ DOSTAVLJAC_CP ][ 10 ] = {
  79.  
  80. {2143.4839,-2252.9707,13.3015,44.6907},
  81. {2197.8823,-1973.9418,13.5584,272.7168},
  82. {2447.8191,-1964.4468,13.5469,0.9570},
  83. {2066.1118,-1991.9330,13.5469,176.4049},
  84. {2494.0667,-1463.5614,24.0246,185.2177},
  85. {2446.4258,-1900.3201,13.5469,178.3327},
  86. {2157.1709,-1797.2056,13.3644,180.1486},
  87. {1220.4326,-1812.2965,16.5938,93.4171},
  88. {957.1688,-1556.5499,13.5781,270.0392},
  89. {2434.6362,-2124.5618,13.5469,183.1550} //Postavljajte dolje
  90.  
  91. };
  92.  
  93. //----------------------------------------------------------------------------//
  94.  
  95. #if defined FILTERSCRIPT
  96.  
  97. public OnFilterScriptInit( )
  98. {
  99. print("|--------------------------------------|");
  100. print(" Dostavljac Goriva by Bolex_! ");
  101. print("|--------------------------------------|");
  102.  
  103. PosaoPick = CreatePickup( 1650, 2, 1902.5525,-1776.3734,13.5469, 0 );
  104. POSAO_T = Create3DTextLabel( "{ADFF2F}[ Dostavljac Goriva ]\n{ADFF2F}Ugovor: {FFFFFF}Stalni\n{ADFF2F}Da se zaposlite stanite ovdje i {FFFFFF}Prihvati posao",-1,1902.5525,-1776.3734,13.5469,30.0,0,40 );
  105.  
  106. UtovarPick = CreatePickup( 3632, 1, 1938.2350,-1773.1140,13.3828, 0 );
  107. UTOVAR_P = Create3DTextLabel( "{ADFF2F}[ Gorivo - Utovar ]\n{ADFF2F}Broj utovara: {FFFFFF}5\n{ADFF2F}Za utovar ovog tereta upisite {FFFFFF}[ /utovar ]!",-1,1938.2350,-1773.1140,13.3828,30.0,0,1 );
  108.  
  109. DisableInteriorEnterExits( );
  110.  
  111. //------------------------------------------------------------------------//
  112. CreateObject(638, 1927.84741, -1767.55627, 13.22687, 0.00000, 0.00000, 180.00000);
  113. CreateObject(638, 1926.12695, -1766.56580, 13.22687, 0.00000, 0.00000, -90.20003);
  114. CreateObject(638, 1923.45703, -1766.55652, 13.22687, 0.00000, 0.00000, -90.20003);
  115. CreateObject(638, 1920.78687, -1766.54724, 13.22687, 0.00000, 0.00000, -90.20003);
  116. CreateObject(638, 1918.11621, -1766.53796, 13.22687, 0.00000, 0.00000, -90.20003);
  117. CreateObject(638, 1915.76599, -1766.52942, 13.21687, 0.00000, 0.00000, -90.20003);
  118. CreateObject(638, 1927.84741, -1770.22717, 13.22687, 0.00000, 0.00000, 180.00000);
  119. CreateObject(638, 1927.84741, -1772.89832, 13.22687, 0.00000, 0.00000, 180.00000);
  120. CreateObject(638, 1927.84741, -1775.55896, 13.22687, 0.00000, 0.00000, 180.00000);
  121. CreateObject(638, 1927.84741, -1778.23889, 13.22687, 0.00000, 0.00000, 180.00000);
  122. CreateObject(638, 1927.84741, -1780.91919, 13.22687, 0.00000, 0.00000, 180.00000);
  123. CreateObject(638, 1927.84741, -1783.59998, 13.22687, 0.00000, 0.00000, 180.00000);
  124. CreateObject(638, 1927.84741, -1785.07043, 13.21687, 0.00000, 0.00000, 180.00000);
  125. CreateObject(638, 1926.14954, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  126. CreateObject(638, 1923.47974, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  127. CreateObject(638, 1920.81982, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  128. CreateObject(638, 1918.15869, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
  129. CreateObject(638, 1915.70862, -1786.07776, 13.21687, 0.00000, 0.00000, 90.00000);
  130. CreateObject(3657, 1923.41235, -1767.50598, 12.98687, 0.00000, 0.00000, 0.00000);
  131. CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
  132. CreateObject(3657, 1917.75244, -1785.18591, 12.98687, 0.00000, 0.00000, 180.00000);
  133. CreateObject(3657, 1923.41235, -1785.18652, 12.98687, 0.00000, 0.00000, 180.00000);
  134. CreateObject(3515, 1920.14966, -1776.90234, 11.97686, 0.00000, 0.00000, 0.00000);
  135. CreateObject(19304, 1920.01746, -1774.35498, 12.86280, 0.00000, 0.00000, 1.10000);
  136. CreateObject(19304, 1920.01953, -1779.44495, 12.86280, 0.00000, 0.00000, 1.90000);
  137. CreateObject(19304, 1917.40759, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
  138. CreateObject(19304, 1922.56641, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
  139. CreateObject(3657, 1917.75244, -1767.48584, 12.98687, 0.00000, 0.00000, 0.00000);
  140. CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
  141. CreateObject(3657, 1920.09326, -1773.73816, 12.98687, 0.00000, 0.00000, -179.19998);
  142. CreateObject(3657, 1923.09241, -1776.80762, 12.98687, 0.00000, 0.00000, 90.00000);
  143. CreateObject(3657, 1916.82324, -1776.89807, 12.98687, 0.00000, 0.00000, -89.89999);
  144. CreateObject(628, 1917.47778, -1774.25671, 14.48688, 0.00000, 0.00000, 130.69997);
  145. CreateObject(628, 1922.73438, -1773.92786, 14.48688, 0.00000, 0.00000, 41.29998);
  146. CreateObject(628, 1922.81885, -1779.53015, 14.48688, 0.00000, 0.00000, -18.70002);
  147. CreateObject(628, 1917.30359, -1779.75232, 14.48688, 0.00000, 0.00000, -136.50002);
  148. CreateObject(1536, 1900.93530, -1777.19812, 12.54690, 0.00000, 0.00000, 90.00000);
  149. CreateObject(1676, 1940.22900, -1776.39075, 13.89281, 0.00000, 0.00000, 90.00000);
  150. CreateObject(1676, 1940.22900, -1769.32007, 13.89281, 0.00000, 0.00000, 90.00000);
  151. CreateObject(19304, 1941.04785, -1776.01440, 12.55280, 0.00000, 0.00000, 90.00000);
  152. CreateObject(19304, 1941.04785, -1772.53418, 12.55280, 0.00000, 0.00000, 90.00000);
  153. CreateObject(19304, 1941.04785, -1769.83276, 12.55280, 0.00000, 0.00000, 90.00000);
  154. CreateObject(19304, 1939.49731, -1769.90393, 12.55280, 0.00000, 0.00000, 90.00000);
  155. CreateObject(19304, 1939.49731, -1773.37402, 12.55280, 0.00000, 0.00000, 90.00000);
  156. CreateObject(19304, 1939.49731, -1775.89490, 12.55280, 0.00000, 0.00000, 90.00000);
  157. CreateObject(1361, 1940.23840, -1778.36450, 12.87686, 0.00000, 0.00000, 0.00000);
  158. CreateObject(1361, 1940.23840, -1767.62451, 12.87686, 0.00000, 0.00000, 0.00000);
  159. CreateObject(6958, 1940.49646, -1773.03503, 20.91687, 0.00000, 0.00000, 0.00000);
  160. CreateObject(11417, 1940.28088, -1772.99634, 17.11281, 0.00000, 0.00000, -45.10001);
  161. CreateObject(1412, 1900.86987, -1762.39783, 13.79230, 0.00000, 0.00000, 0.51010);
  162. CreateObject(1412, 1906.14221, -1762.34680, 13.79230, 0.00000, 0.00000, 0.51010);
  163. CreateObject(1412, 1917.06885, -1762.26270, 13.79230, 0.00000, 0.00000, 0.51010);
  164. CreateObject(1412, 1922.60889, -1762.23621, 13.79230, 0.00000, 0.00000, 0.51010);
  165. CreateObject(1412, 1928.15308, -1762.18884, 13.79230, 0.00000, 0.00000, 0.51010);
  166. CreateObject(3633, 1902.44336, -1764.61243, 13.98450, 0.00000, 0.00000, 0.00000);
  167. CreateObject(3633, 1902.44336, -1764.61243, 13.02890, 0.00000, 0.00000, 0.00000);
  168. CreateObject(3632, 1941.77197, -1778.65820, 12.84090, 0.00000, 0.00000, 0.00000);
  169. CreateObject(3632, 1941.31543, -1779.30273, 12.84090, 0.00000, 0.00000, 0.00000);
  170. CreateObject(925, 1901.77673, -1785.73425, 13.57390, 0.00000, 0.00000, 90.01359);
  171. CreateObject(925, 1901.88110, -1789.45569, 13.57390, 0.00000, 0.00000, 90.01359);
  172. CreateObject(1222, 1902.19812, -1780.19250, 12.98960, 0.00000, 0.00000, 0.00000);
  173. CreateObject(1222, 1903.16638, -1780.45349, 12.98960, 0.00000, 0.00000, 0.00000);
  174. CreateObject(1222, 1902.83459, -1779.60364, 12.98960, 0.00000, 0.00000, 0.00000);
  175. //------------------------------------------------------------------------//
  176.  
  177. POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 0 ] ] = 0; POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 1 ] ]= 0;
  178. POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 2 ] ] = 0; POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 3 ] ]= 0;
  179. POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 4 ] ] = 0; POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[ 5 ] ]= 0;
  180.  
  181. DOSTAVLJAC_VOZILA[ 0 ] = CreateVehicle(428,1914.7301,-1793.1829,13.5069,330.3089,3,3,60000,0);
  182. DOSTAVLJAC_VOZILA[ 1 ] = CreateVehicle(428,1918.4766,-1794.1277,13.5067,329.4436,3,3,60000,0);
  183. DOSTAVLJAC_VOZILA[ 2 ] = CreateVehicle(428,1922.5284,-1794.1038,13.5070,329.2636,3,3,60000,0);
  184. DOSTAVLJAC_VOZILA[ 3 ] = CreateVehicle(428,1926.5687,-1794.2007,13.5078,330.4030,3,3,60000,0);
  185. DOSTAVLJAC_VOZILA[ 4 ] = CreateVehicle(428,1933.0986,-1784.5759,13.5075,0.5458,3,3,60000,0);
  186. DOSTAVLJAC_VOZILA[ 5 ] = CreateVehicle(428,1932.8470,-1770.1198,13.5072,180.5444,3,3,60000,0);
  187.  
  188. //------------------------------------------------------------------------//
  189. PosaoTD = TextDrawCreate(119.500000, 165.125000, "usebox");
  190. TextDrawLetterSize(PosaoTD, 0.000000, 15.044445);
  191. TextDrawTextSize(PosaoTD, 34.500000, 0.000000);
  192. TextDrawAlignment(PosaoTD, 1);
  193. TextDrawColor(PosaoTD, 0);
  194. TextDrawUseBox(PosaoTD, true);
  195. TextDrawBoxColor(PosaoTD, 102);
  196. TextDrawSetShadow(PosaoTD, 0);
  197. TextDrawSetOutline(PosaoTD, 0);
  198. TextDrawFont(PosaoTD, 0);
  199.  
  200. PosaoTD1 = TextDrawCreate(41.000000, 168.187500, "usebox");
  201. TextDrawLetterSize(PosaoTD1, 0.000000, 14.262499);
  202. TextDrawTextSize(PosaoTD1, 112.500000, 0.000000);
  203. TextDrawAlignment(PosaoTD1, 1);
  204. TextDrawColor(PosaoTD1, 0);
  205. TextDrawUseBox(PosaoTD1, true);
  206. TextDrawBoxColor(PosaoTD1, 255);
  207. TextDrawSetShadow(PosaoTD1, 0);
  208. TextDrawSetOutline(PosaoTD1, 0);
  209. TextDrawFont(PosaoTD1, 0);
  210.  
  211. PosaoTD2 = TextDrawCreate(47.000000, 170.187500, "DOSTAVLJAC GORIVA");
  212. TextDrawLetterSize(PosaoTD2, 0.132500, 0.738125);
  213. TextDrawAlignment(PosaoTD2, 1);
  214. TextDrawColor(PosaoTD2, -1);
  215. TextDrawSetShadow(PosaoTD2, 0);
  216. TextDrawSetOutline(PosaoTD2, 1);
  217. TextDrawBackgroundColor(PosaoTD2, 51);
  218. TextDrawFont(PosaoTD2, 2);
  219. TextDrawSetProportional(PosaoTD2, 1);
  220.  
  221. PosaoTD3 = TextDrawCreate(43.000000, 175.875000, "-------------------------");
  222. TextDrawLetterSize(PosaoTD3, 0.204500, 0.790626);
  223. TextDrawAlignment(PosaoTD3, 1);
  224. TextDrawColor(PosaoTD3, -5963521);
  225. TextDrawUseBox(PosaoTD3, true);
  226. TextDrawBoxColor(PosaoTD3, 0);
  227. TextDrawSetShadow(PosaoTD3, 0);
  228. TextDrawSetOutline(PosaoTD3, 1);
  229. TextDrawBackgroundColor(PosaoTD3, 51);
  230. TextDrawFont(PosaoTD3, 2);
  231. TextDrawSetProportional(PosaoTD3, 1);
  232.  
  233. PosaoTD4 = TextDrawCreate(50.000000, 197.750000, "PRIHVATI POSAO");
  234. TextDrawLetterSize(PosaoTD4, 0.148499, 0.777500);
  235. TextDrawAlignment(PosaoTD4, 1);
  236. TextDrawColor(PosaoTD4, -1);
  237. TextDrawSetShadow(PosaoTD4, 0);
  238. TextDrawSetOutline(PosaoTD4, 1);
  239. TextDrawBackgroundColor(PosaoTD4, 51);
  240. TextDrawFont(PosaoTD4, 2);
  241. TextDrawSetProportional(PosaoTD4, 1);
  242. TextDrawSetSelectable(PosaoTD4, true);
  243.  
  244. PosaoTD5 = TextDrawCreate(59.000000, 217.437500, "ODUSTANI");
  245. TextDrawLetterSize(PosaoTD5, 0.147499, 0.786250);
  246. TextDrawAlignment(PosaoTD5, 1);
  247. TextDrawColor(PosaoTD5, -1);
  248. TextDrawSetShadow(PosaoTD5, 0);
  249. TextDrawSetOutline(PosaoTD5, 1);
  250. TextDrawBackgroundColor(PosaoTD5, 51);
  251. TextDrawFont(PosaoTD5, 2);
  252. TextDrawSetProportional(PosaoTD5, 1);
  253. TextDrawSetSelectable(PosaoTD5, true);
  254.  
  255. PosaoTD6 = TextDrawCreate(43.000000, 249.812500, "ZARADA: ~y~PO LOKACIJI + BONUS");
  256. TextDrawLetterSize(PosaoTD6, 0.104500, 0.580626);
  257. TextDrawAlignment(PosaoTD6, 1);
  258. TextDrawColor(PosaoTD6, -1);
  259. TextDrawSetShadow(PosaoTD6, 0);
  260. TextDrawSetOutline(PosaoTD6, 1);
  261. TextDrawBackgroundColor(PosaoTD6, 51);
  262. TextDrawFont(PosaoTD6, 2);
  263. TextDrawSetProportional(PosaoTD6, 1);
  264. //------------------------------------------------------------------------//
  265. return 1;
  266. }
  267.  
  268. //----------------------------------------------------------------------------//
  269.  
  270. public OnFilterScriptExit( )
  271. {
  272. print("|--------------------------------------|");
  273. print(" Dostavljac Goriva by Bolex_! Zatvoren!");
  274. print("|--------------------------------------|");
  275.  
  276. Delete3DTextLabel(POSAO_T); Delete3DTextLabel(UTOVAR_P);
  277. DestroyPickup(PosaoPick); DestroyPickup(UtovarPick);
  278. DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 0 ]); DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 1 ]);
  279. DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 2 ]); DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 3 ]);
  280. DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 4 ]); DestroyVehicle(POSAO_DOSTAVLJAC_VOZILA[ 5 ]);
  281. return 1;
  282. }
  283.  
  284. //----------------------------------------------------------------------------//
  285.  
  286. PreloadAnimLib(playerid, animlib[])
  287. {
  288. ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  289. }
  290. public OnPlayerConnect( playerid )
  291. {
  292. PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"DEALER");
  293. AktivanPosao[ playerid ] =0; PosaoBonus[ playerid ] =0; PosaoZarada[ playerid ] =0; IgracOprema[ playerid ] =0;
  294. IgracCP[ playerid ] = NEGATIVNA_LOKACIJA;
  295.  
  296. //---//
  297. RemoveBuildingForPlayer(playerid, 5535, 1918.8516, -1776.3281, 16.9766, 0.25);
  298. RemoveBuildingForPlayer(playerid, 1524, 1910.1641, -1779.6641, 18.7500, 0.25);
  299. RemoveBuildingForPlayer(playerid, 5681, 1921.4844, -1778.9141, 18.5781, 0.25);
  300. RemoveBuildingForPlayer(playerid, 5409, 1918.8516, -1776.3281, 16.9766, 0.25);
  301. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1778.4531, 14.1406, 0.25);
  302. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1774.3125, 14.1406, 0.25);
  303. RemoveBuildingForPlayer(playerid, 955, 1928.7344, -1772.4453, 12.9453, 0.25);
  304. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1771.3438, 14.1406, 0.25);
  305. RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1767.2891, 14.1406, 0.25);
  306. RemoveBuildingForPlayer(playerid, 1226, 1955.6641, -1793.0938, 16.3906, 0.25);
  307. //---//
  308. return 1;
  309. }
  310.  
  311. public OnPlayerDisconnect(playerid, reason)
  312. {
  313. AktivanPosao[ playerid ] =0; PosaoBonus[ playerid ] =0; PosaoZarada[ playerid ] =0; IgracOprema[ playerid ] =0; HidePlayerPosaoInfo( playerid );
  314. IgracCP[ playerid ] = NEGATIVNA_LOKACIJA;
  315. return 1;
  316. }
  317.  
  318. public OnPlayerDeath(playerid, killerid, reason)
  319. {
  320. if(AktivanPosao[ playerid ] == 1)
  321. {
  322. AktivanPosao[ playerid ] =0; PosaoBonus[ playerid ] =0; PosaoZarada[ playerid ] =0; IgracOprema[ playerid ] =0;
  323. IgracCP[ playerid ] =NEGATIVNA_LOKACIJA;
  324. DisablePlayerCheckpoint( playerid );
  325. HidePlayerPosaoInfo( playerid );
  326. SCM(playerid, 0x48977996,"[POSAO]: {FFFFFF}Napustili ste vozilo te je posao zavrsen!");
  327. }
  328. return 1;
  329. }
  330. CMD:utovar(playerid, params[])
  331. {
  332. if(AktivanPosao[ playerid ] == 1)
  333. {
  334. if(IsPlayerInRangeOfPoint(playerid,3.0, 1938.2350,-1773.1140,13.3828))
  335. {
  336. if(GetPlayerState( playerid ) == PLAYER_STATE_DRIVER)
  337. {
  338. if(POSAO_DOSTAVLJAC_VOZILA[GetPlayerVehicleID( playerid )] == 0)
  339. {
  340. new string[56];
  341. POSAO_DOSTAVLJAC_VOZILA[GetPlayerVehicleID( playerid )]=5;
  342. SCM(playerid, 0x48977996,"[UTOVAR]: {FFFFFF}Utovarili ste teret, dostavi ga lokacijama postavljenim crvenim markerom!");
  343.  
  344. PlayerTextDrawHide(playerid,DostavljacInfo[ playerid ]);
  345. format(string,sizeof(string),"ZA DOSTAVITI: ~y~%d/5",POSAO_DOSTAVLJAC_VOZILA[GetPlayerVehicleID( playerid )]);
  346. PlayerTextDrawSetString(playerid,DostavljacInfo[ playerid ],string);
  347. PlayerTextDrawShow(playerid,DostavljacInfo[ playerid ]);
  348. }
  349. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}U vozilu imas jos tereta kojeg moras dostaviti!");
  350. }
  351. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Morate biti u vozilu!");
  352. }
  353. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Nisi sa vozilom na mjestu za utovar tereta!");
  354. }
  355. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Ne radis ni jedan dio posla!");
  356. return 1;
  357. }
  358. CMD:prekiniposao(playerid, params[])
  359. {
  360. if(AktivanPosao[ playerid ] == 1)
  361. {
  362. new string[128];
  363. GivePlayerMoney(playerid,PosaoZarada[ playerid ]+PosaoBonus[ playerid ]);
  364. format(string,sizeof(string),"[INFO]: {FFFFFF}Trenutno si zaradio %d$ nakon obavljenog posla!",PosaoZarada[ playerid ]+PosaoBonus[ playerid ]);
  365. SCM(playerid,0x48977996,string);
  366. PosaoZarada[ playerid ] =0; PosaoBonus[ playerid ] =0; AktivanPosao[ playerid ] =0; IgracOprema[ playerid ] =0;
  367. if(IsPlayerAttachedObjectSlotUsed(playerid, DOSTAVLJAC_BR)) { RemovePlayerAttachedObject(playerid, DOSTAVLJAC_BR); }
  368. IgracCP[ playerid ]= NEGATIVNA_LOKACIJA;
  369. HidePlayerPosaoInfo( playerid );
  370. POSAO_DOSTAVLJAC_VOZILA[GetPlayerVehicleID( playerid )]=0;
  371. SetVehicleToRespawn(GetPlayerVehicleID( playerid ));
  372. RemovePlayerFromVehicle( playerid );
  373. SetPlayerSkin(playerid,IgracOprema[ playerid ]);
  374. DisablePlayerCheckpoint( playerid );
  375.  
  376. }
  377. else SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Nisi zaposlen kao dostavljac goriva!");
  378. return 1;
  379. }
  380. CMD:uzmigas(playerid, params[])
  381. {
  382. if(AktivanPosao[ playerid ] == 1)
  383. {
  384. if(!IsPlayerAttachedObjectSlotUsed(playerid, DOSTAVLJAC_BR))
  385. {
  386. if(GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT)
  387. {
  388. new Float:X,Float:Y,Float:Z;
  389. for( new j=0;j<6;j++ )
  390. {
  391. GetVehiclePos( DOSTAVLJAC_VOZILA[j],X,Y,Z );
  392. if(IsPlayerInRangeOfPoint( playerid,3.0,X,Y,Z ))
  393. {
  394. if(POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[j]] >= 1)
  395. {
  396. POSAO_DOSTAVLJAC_VOZILA[ DOSTAVLJAC_VOZILA[j]]--;
  397. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  398. SetPlayerAttachedObject( playerid, DOSTAVLJAC_BR, 3632, 1, 0.002953, 0.469660, -0.009797, 269.851104, 88.443557, 0.000000, 0.804894, 1.000000, 0.822361 );
  399. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Ostavite bocu goriva na crveni marker!");
  400. return 1;
  401. }
  402. else
  403. {
  404. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Nemate vise tereta, otidite po novi");
  405. return 1;
  406. }
  407. }
  408. }
  409. }
  410. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Morate izaci iz vozila");
  411. }
  412. else return SCM(playerid,-1," {E10000}(Info): {FFFFFF}Vec si uzeo jednu bocu goriva!");
  413. }
  414. return 1;
  415. }
  416. CMD:test(playerid, params[])
  417. {
  418. SetPlayerPos(playerid, 1935.1696,-1794.7130,13.5469);
  419. return 1;
  420. }
  421. public ShowPlayerPosaoInfo( playerid )
  422. {
  423. new string[56];
  424. format(string,sizeof(string),"ZA DOSTAVITI: ~y~%d/5",POSAO_DOSTAVLJAC_VOZILA[GetPlayerVehicleID(playerid)]);
  425. DostavljacInfo[ playerid ] = CreatePlayerTextDraw(playerid,524.500000, 125.562500, string);
  426. PlayerTextDrawBackgroundColor(playerid,DostavljacInfo[ playerid ], 51);
  427. PlayerTextDrawFont(playerid,DostavljacInfo[ playerid ], 2);
  428. PlayerTextDrawLetterSize(playerid,DostavljacInfo[ playerid ], 0.155000, 0.716250);
  429. PlayerTextDrawColor(playerid,DostavljacInfo[ playerid ], -1);
  430. PlayerTextDrawSetOutline(playerid,DostavljacInfo[ playerid ], 1);
  431. PlayerTextDrawSetProportional(playerid,DostavljacInfo[ playerid ], 1);
  432. PlayerTextDrawSetSelectable(playerid,DostavljacInfo[ playerid ], 0);
  433.  
  434. BacvaPrew[ playerid ] = CreatePlayerTextDraw(playerid,497.500000, 140.000000, " ");
  435. PlayerTextDrawFont(playerid,BacvaPrew[ playerid ], 5);
  436. PlayerTextDrawLetterSize(playerid,BacvaPrew[ playerid ], 0.449999, 1.600000);
  437. PlayerTextDrawColor(playerid,BacvaPrew[ playerid ], -1);
  438. PlayerTextDrawSetOutline(playerid,BacvaPrew[ playerid ], 0);
  439. PlayerTextDrawSetProportional(playerid,BacvaPrew[ playerid ], 1);
  440. PlayerTextDrawSetShadow(playerid,BacvaPrew[ playerid ], 0);
  441. PlayerTextDrawBackgroundColor(playerid,BacvaPrew[ playerid ], 0x00000000);
  442. PlayerTextDrawBoxColor(playerid,BacvaPrew[ playerid ], 45312);
  443. PlayerTextDrawTextSize(playerid,BacvaPrew[ playerid ], 28.500000, -21.437500);
  444. PlayerTextDrawSetSelectable(playerid,BacvaPrew[ playerid ], 0);
  445. PlayerTextDrawSetPreviewModel(playerid,BacvaPrew[ playerid ],3632);
  446. PlayerTextDrawSetPreviewRot(playerid,BacvaPrew[ playerid ],216.000000, 0.000000, 0.000000, 1.000000);
  447.  
  448. format(string,sizeof(string),"ZARADA: ~y~%d~g~$",PosaoZarada[ playerid ]);
  449. ZaradaInfo[ playerid ] = CreatePlayerTextDraw(playerid,527.000000, 139.125000, string);
  450. PlayerTextDrawBackgroundColor(playerid,ZaradaInfo[ playerid ], 51);
  451. PlayerTextDrawFont(playerid,ZaradaInfo[ playerid ], 2);
  452. PlayerTextDrawLetterSize(playerid,ZaradaInfo[ playerid ], 0.154500, 0.589376);
  453. PlayerTextDrawColor(playerid,ZaradaInfo[ playerid ], -1);
  454. PlayerTextDrawSetOutline(playerid,ZaradaInfo[ playerid ], 1);
  455. PlayerTextDrawSetProportional(playerid,ZaradaInfo[ playerid ], 1);
  456. PlayerTextDrawSetSelectable(playerid,ZaradaInfo[ playerid ], 0);
  457.  
  458. format(string,sizeof(string),"BONUS: ~y~+%d~g~$",PosaoBonus[ playerid ]);
  459. BonusInfo[ playerid ] = CreatePlayerTextDraw(playerid,533.000000, 145.250000, string);
  460. PlayerTextDrawBackgroundColor(playerid,BonusInfo[ playerid ], 51);
  461. PlayerTextDrawFont(playerid,BonusInfo[ playerid ], 2);
  462. PlayerTextDrawLetterSize(playerid,BonusInfo[ playerid ], 0.150000, 0.589375);
  463. PlayerTextDrawColor(playerid,BonusInfo[ playerid ], -1);
  464. PlayerTextDrawSetOutline(playerid,BonusInfo[ playerid ], 1);
  465. PlayerTextDrawSetProportional(playerid,BonusInfo[ playerid ], 1);
  466. PlayerTextDrawSetSelectable(playerid,BonusInfo[ playerid ], 0);
  467.  
  468. format(string,sizeof(string),"UKUPNA ZARADA: ~y~%d~g~$",PosaoZarada[ playerid ]+PosaoBonus[ playerid ]);
  469. TotalZaradaInfo[ playerid ] = CreatePlayerTextDraw(playerid,554.500000, 166.687500, string);
  470. PlayerTextDrawBackgroundColor(playerid,TotalZaradaInfo[ playerid ], 51);
  471. PlayerTextDrawFont(playerid,TotalZaradaInfo[ playerid ], 1);
  472. PlayerTextDrawLetterSize(playerid,TotalZaradaInfo[ playerid ], 0.140000, 0.698750);
  473. PlayerTextDrawColor(playerid,TotalZaradaInfo[ playerid ], -1);
  474. PlayerTextDrawSetOutline(playerid,TotalZaradaInfo[ playerid ], 1);
  475. PlayerTextDrawSetProportional(playerid,TotalZaradaInfo[ playerid ], 1);
  476. PlayerTextDrawSetSelectable(playerid,TotalZaradaInfo[ playerid ], 0);
  477. PlayerTextDrawAlignment(playerid,TotalZaradaInfo[ playerid ], 2);
  478.  
  479. Info0 = TextDrawCreate(495.500000, 116.125000, "usebox");
  480. TextDrawLetterSize(Info0, 0.000000, 6.780555);
  481. TextDrawTextSize(Info0, 615.000000, 0.000000);
  482. TextDrawAlignment(Info0, 1);
  483. TextDrawColor(Info0, 0);
  484. TextDrawUseBox(Info0, true);
  485. TextDrawBoxColor(Info0, 102);
  486. TextDrawSetShadow(Info0, 0);
  487. TextDrawSetOutline(Info0, 0);
  488. TextDrawFont(Info0, 0);
  489.  
  490. Info1 = TextDrawCreate(496.000000, 103.875000, "usebox");
  491. TextDrawLetterSize(Info1, 0.000000, 0.995833);
  492. TextDrawTextSize(Info1, 614.500000, 0.000000);
  493. TextDrawAlignment(Info1, 1);
  494. TextDrawColor(Info1, 0);
  495. TextDrawUseBox(Info1, true);
  496. TextDrawBoxColor(Info1, 102);
  497. TextDrawSetShadow(Info1, 0);
  498. TextDrawSetOutline(Info1, 0);
  499. TextDrawFont(Info1, 0);
  500.  
  501. Info2 = TextDrawCreate(616.000000, 114.187500, "LD_SPAC:white");
  502. TextDrawLetterSize(Info2, 0.000000, 0.000000);
  503. TextDrawTextSize(Info2, -121.500000, 0.437500);
  504. TextDrawAlignment(Info2, 1);
  505. TextDrawColor(Info2, -5963521);
  506. TextDrawSetShadow(Info2, 0);
  507. TextDrawSetOutline(Info2, 0);
  508. TextDrawBackgroundColor(Info2, -5963521);
  509. TextDrawFont(Info2, 4);
  510.  
  511. Info3 = TextDrawCreate(510.000000, 103.687500, "INFO - DOSTAVLJAC");
  512. TextDrawLetterSize(Info3, 0.212500, 0.926251);
  513. TextDrawAlignment(Info3, 1);
  514. TextDrawColor(Info3, -1);
  515. TextDrawSetShadow(Info3, 0);
  516. TextDrawSetOutline(Info3, 1);
  517. TextDrawBackgroundColor(Info3, 51);
  518. TextDrawFont(Info3, 2);
  519. TextDrawSetProportional(Info3, 1);
  520.  
  521. Info4 = TextDrawCreate(523.500000, 172.375000, "IIIIIIIIIIIIIIIIIIIIIIIII");
  522. TextDrawLetterSize(Info4, 0.187999, 0.768750);
  523. TextDrawAlignment(Info4, 1);
  524. TextDrawColor(Info4, -5963521);
  525. TextDrawUseBox(Info4, true);
  526. TextDrawBoxColor(Info4, 0);
  527. TextDrawSetShadow(Info4, 0);
  528. TextDrawSetOutline(Info4, 1);
  529. TextDrawBackgroundColor(Info4, 51);
  530. TextDrawFont(Info4, 2);
  531. TextDrawSetProportional(Info4, 1);
  532.  
  533. Info5 = TextDrawCreate(575.000000, 122.937500, "New Textdraw");
  534. TextDrawLetterSize(Info5, 0.449999, 1.600000);
  535. TextDrawTextSize(Info5, 48.500000, 43.750000);
  536. TextDrawAlignment(Info5, 1);
  537. TextDrawColor(Info5, -1);
  538. TextDrawBoxColor(Info5, 0x00000000);
  539. TextDrawBackgroundColor(Info5, 0x00000000);
  540. TextDrawSetShadow(Info5, 0);
  541. TextDrawSetOutline(Info5, 1);
  542. TextDrawFont(Info5, 5);
  543. TextDrawSetProportional(Info5, 1);
  544. TextDrawSetPreviewModel(Info5, 428);
  545. TextDrawSetPreviewRot(Info5, 1.000000, 1.000000, 315.000000, 1.000000);
  546.  
  547. TextDrawShowForPlayer(playerid, Info0); TextDrawShowForPlayer(playerid, Info1);
  548. TextDrawShowForPlayer(playerid, Info2); TextDrawShowForPlayer(playerid, Info3);
  549. TextDrawShowForPlayer(playerid, Info4); TextDrawShowForPlayer(playerid, Info5);
  550.  
  551. PlayerTextDrawShow(playerid, DostavljacInfo[ playerid ]);
  552. PlayerTextDrawShow(playerid, BacvaPrew[ playerid ]);
  553. PlayerTextDrawShow(playerid, ZaradaInfo[ playerid ]);
  554. PlayerTextDrawShow(playerid, TotalZaradaInfo[ playerid ]);
  555. PlayerTextDrawShow(playerid, BonusInfo[ playerid ]);
  556. return 1;
  557. }
  558.  
  559. public HidePlayerPosaoInfo( playerid )
  560. {
  561. TextDrawHideForPlayer(playerid, Info0); TextDrawHideForPlayer(playerid, Info1); TextDrawHideForPlayer(playerid, Info2);
  562. TextDrawHideForPlayer(playerid, Info3); TextDrawHideForPlayer(playerid, Info4); TextDrawHideForPlayer(playerid, Info5);
  563.  
  564. PlayerTextDrawDestroy(playerid, DostavljacInfo[ playerid ]);
  565. PlayerTextDrawDestroy(playerid, BacvaPrew[ playerid ]);
  566. PlayerTextDrawDestroy(playerid, ZaradaInfo[ playerid ]);
  567. PlayerTextDrawDestroy(playerid, TotalZaradaInfo[ playerid ]);
  568. PlayerTextDrawDestroy(playerid, BonusInfo[ playerid ]);
  569. return 1;
  570. }
  571. public OnPlayerStateChange(playerid, newstate, oldstate)
  572. {
  573. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  574. {
  575. if(IsPlayerAttachedObjectSlotUsed(playerid, DOSTAVLJAC_BR))
  576. {
  577. RemovePlayerFromVehicle( playerid );
  578. SetPlayerArmedWeapon( playerid, 0);
  579. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  580. }
  581. new VID = GetPlayerVehicleID( playerid );
  582. if(VID == DOSTAVLJAC_VOZILA[ 0 ] || VID == DOSTAVLJAC_VOZILA[ 1 ] || VID == DOSTAVLJAC_VOZILA[ 2 ] || VID == DOSTAVLJAC_VOZILA[ 3 ] || VID == DOSTAVLJAC_VOZILA[ 4 ] || VID == DOSTAVLJAC_VOZILA[ 5 ])
  583. {
  584. if(AktivanPosao[ playerid ] == 1)
  585. {
  586. ShowPlayerPosaoInfo( playerid );
  587. if(IgracCP[ playerid ] == NEGATIVNA_LOKACIJA)
  588. {
  589. new rand = random(sizeof(LOKACIJE));
  590. new oprema = random(311)+1;
  591. if(oprema == 74) return oprema=75;
  592. SetPlayerCheckpoint(playerid, LOKACIJE[rand][ 0 ], LOKACIJE[rand][ 1 ], LOKACIJE[rand][ 2 ],2.0);
  593. IgracCP[ playerid ] = LOKACIJA;
  594. }
  595. }
  596. else
  597. {
  598. SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Nisi zaposlen kao dostavljac goriva!");
  599. RemovePlayerFromVehicle( playerid );
  600. }
  601. }
  602. }
  603. else if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) { HidePlayerPosaoInfo( playerid ); }
  604. return 1;
  605. }
  606. public OnPlayerEnterCheckpoint( playerid )
  607. {
  608. if(IgracCP[ playerid ] == LOKACIJA)
  609. {
  610. if(IsPlayerAttachedObjectSlotUsed(playerid, DOSTAVLJAC_BR))
  611. {
  612. new string[128];
  613. new bon=random( DOSTAVLJAC_BONUS + 15 );
  614. PosaoBonus[ playerid ]+=bon;
  615. PosaoZarada[ playerid ]+=ZARADA_PO_LOKACIJI;
  616. format(string,sizeof(string),"[INFO]: {FFFFFF}Zaradio si %d$ i bonus od %d$ za dostavljenu bocu goriva!", ZARADA_PO_LOKACIJI, bon);
  617. SCM(playerid, 0x48977996,string);
  618. RemovePlayerAttachedObject(playerid, DOSTAVLJAC_BR);
  619. IgracCP[ playerid ] = NEGATIVNA_LOKACIJA;
  620. DisablePlayerCheckpoint( playerid );
  621. ClearAnimations( playerid );
  622. }
  623. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Morate uzeti bocu goriva iz vozila kako bi je dostavio na ovoj lokaciji!");
  624. }
  625. return 1;
  626. }
  627. public OnPlayerPickUpPickup(playerid, pickupid)
  628. {
  629. if(pickupid == PosaoPick)
  630. {
  631. TextDrawShowForPlayer(playerid, PosaoTD); TextDrawShowForPlayer(playerid, PosaoTD1); TextDrawShowForPlayer(playerid, PosaoTD2); TextDrawShowForPlayer(playerid, PosaoTD3);
  632. TextDrawShowForPlayer(playerid, PosaoTD4); TextDrawShowForPlayer(playerid, PosaoTD5); TextDrawShowForPlayer(playerid, PosaoTD6);
  633.  
  634. SelectTextDraw(playerid, 0xA3B4C5FF);
  635. }
  636. return 1;
  637. }
  638. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  639. {
  640. if(_:clickedid != INVALID_TEXT_DRAW)
  641. {
  642. if(clickedid == PosaoTD4)
  643. {
  644. if(IsPlayerInRangeOfPoint(playerid,3.0, 1902.5525,-1776.3734,13.5469))
  645. {
  646. if(AktivanPosao[ playerid ] == 0)
  647. {
  648. new string[235];
  649. format(string, sizeof(string),"{FF7E19}Cestitamo! {FFFFFF}Upravo ste se zaposlili kao Dostavljac Goriva!\n\nU ovom poslu je potrebno da dostavite gorivo na odredenim lokacijama nakon utovara\n{FF7E19}Komande posla: {FFFFFF}/utovar /uzmigas /prekiniposao");
  650. SPD(playerid, D_POMOC, DIALOG_STYLE_MSGBOX, "Posao Dostavljac goriva", string, "Ok", "");
  651. SCM(playerid, -1,"{E10000}(Info): {FFFFFF}Udite u vozilo kako bi nastavili sa poslom!");
  652. AktivanPosao[ playerid ] = 1;
  653. IgracOprema[ playerid ] = GetPlayerSkin( playerid );
  654. SetPlayerSkin( playerid, 8 );
  655. }
  656. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Vec si zaposlen kao dostavljac goriva!");
  657. }
  658. else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Nisite na mjestu za zaposljavanje!");
  659. }
  660. else if(clickedid == PosaoTD5)
  661. {
  662. TextDrawHideForPlayer(playerid, PosaoTD5);
  663. }
  664. TextDrawHideForPlayer(playerid, PosaoTD); TextDrawHideForPlayer(playerid, PosaoTD1); TextDrawHideForPlayer(playerid, PosaoTD2); TextDrawHideForPlayer(playerid, PosaoTD3);
  665. TextDrawHideForPlayer(playerid, PosaoTD4); TextDrawHideForPlayer(playerid, PosaoTD5); TextDrawHideForPlayer(playerid, PosaoTD6);
  666.  
  667. CancelSelectTextDraw( playerid );
  668. }
  669. return 1;
  670. }
  671. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  672. {
  673. if(PRESSED(KEY_FIRE))
  674. {
  675. if(IsPlayerAttachedObjectSlotUsed(playerid, DOSTAVLJAC_BR))
  676. {
  677. ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
  678. SetPlayerArmedWeapon( playerid, 0 );
  679. }
  680. }
  681. return 1;
  682. }
  683. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement