Guest User

Dostavuvac na Avto Delovi

a guest
May 18th, 2020
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.76 KB | None | 0 0
  1. /*
  2. Izraboteno od: Tino Skripter
  3. Dostavuvac na Avto Delovi
  4. Ako najdete nekoj bug prijavete go ! :)
  5. */
  6. //========================[INLUCE]==============================================
  7. #include <a_samp>
  8. #include <streamer>
  9. #pragma tabsize 0
  10. //------------------------------------------------------------------------------
  11. stock CreateHigherObject(modelid, Float:x3, Float:y3, Float:z3, Float:rx3, Float:ry3, Float:rz3)
  12. {
  13. CreateDynamicObjectEx(modelid, x3, y3, z3+500.0000, rx3, ry3, rz3, 300.00, 300.00);
  14. }
  15.  
  16. stock CreateObjectE1000(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ)
  17. {
  18. CreateDynamicObjectEx(modelid, Float:X, Float:Y, Float:Z+1000, Float:rX, Float:rY, Float:rZ, 300.00, 300.00);
  19. }
  20. //------------------------[BOI]-------------------------------------------------
  21. #define COLOR_WHITE 0xFFFFFFFF
  22. #define COLOR_LIGHTGREEN 0xAFFFA1FF
  23. //---------------------[DIALOZI]------------------------------------------------
  24. #define DIALOG_STATUS1 (1)
  25. #define DIALOG_EVEME1 (2)
  26. //------------------------------------------------------------------------------
  27. //STAVENA E EDNA POZICIJA ZA TEST VIE STAVETE KOLKU SAKATE :)
  28. new Float:Nosenje[][] = {
  29. {1381.9080,-1864.0359,13.5469},
  30. {1381.9080,-1864.0359,13.5469},
  31. {1381.9080,-1864.0359,13.5469},
  32. {1381.9080,-1864.0359,13.5469},
  33. {1381.9080,-1864.0359,13.5469}
  34. };
  35. //------------------------------------------------------------------------------
  36. //----------------------[NEWOV]-------------------------------------------------
  37. new
  38. Vremeto[MAX_PLAYERS],
  39. Sirabotam[MAX_PLAYERS],
  40. Davamdel[MAX_PLAYERS],
  41. Imamdelovi[MAX_PLAYERS],
  42. ImaDel[MAX_PLAYERS],
  43. Vehicle[MAX_PLAYERS],
  44. Checkpoint[MAX_PLAYERS],
  45. PlayerText: InfoTD,
  46. Vozilata[6],
  47. Covekot,
  48. Pickupot;
  49. //MAPATA
  50. new tmpobjid;
  51. //============================================================================//
  52. public OnGameModeInit() {
  53. Covekot = CreateActor(60, 1371.9376,-1891.6653,13.5005,276.5909);
  54. SetActorInvulnerable(Covekot, true);
  55. ApplyActorAnimation(Covekot, "COP_AMBIENT", "Coplook_loop", 4.0, 0, 1, 1, 1, -1);
  56. Pickupot = CreatePickup(1210, 23, 1371.5491,-1889.9888,13.5045);
  57. //------------------------------------------------------------------------------
  58. Vozilata[0] = CreateVehicle(482, 1367.3038,-1884.2075,13.2376,359.1702, 0, 0, -1);
  59. Vozilata[1] = CreateVehicle(482, 1370.1227,-1884.0364,13.2282,359.6671, 0, 0, -1);
  60. Vozilata[2] = CreateVehicle(482, 1383.6407,-1878.9045,13.2522,272.3901, 0, 0, -1);
  61. Vozilata[3] = CreateVehicle(482, 1361.6426,-1875.7676,13.2477,254.0692, 0, 0, -1);
  62. // Vozilata[4] = CreateVehicle(482, 2240.5559, -2175.1892, 13.6538, 135.0000, 3, 1, -1);
  63. // Vozilata[5] = CreateVehicle(482, 2245.7339, -2180.4153, 13.6538, 135.0000, 3, 1, -1);
  64. //------------------------------------------------------------------------------
  65. //avtodelovimapa
  66. tmpobjid = CreateDynamicObjectEx(19454, 1384.633422, -1892.204711, 12.491830, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  67. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  68. tmpobjid = CreateDynamicObjectEx(19454, 1384.633422, -1892.214721, 14.741823, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  69. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  70. tmpobjid = CreateDynamicObjectEx(19454, 1394.233886, -1892.204711, 12.491830, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  71. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  72. tmpobjid = CreateDynamicObjectEx(19454, 1394.256103, -1892.214721, 14.741823, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  73. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  74. tmpobjid = CreateDynamicObjectEx(19454, 1384.643432, -1893.895507, 16.411821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  75. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  76. tmpobjid = CreateDynamicObjectEx(19454, 1394.233642, -1893.895507, 16.411821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  77. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  78. tmpobjid = CreateDynamicObjectEx(19454, 1394.233642, -1897.335571, 16.411821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  79. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  80. tmpobjid = CreateDynamicObjectEx(19454, 1394.233642, -1900.777099, 16.411821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  81. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  82. tmpobjid = CreateDynamicObjectEx(19454, 1384.623413, -1900.777099, 16.411821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  83. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  84. tmpobjid = CreateDynamicObjectEx(19454, 1384.623413, -1897.355834, 16.401821, 0.000000, 90.000000, 90.000000, 300.00, 300.00);
  85. SetDynamicObjectMaterial(tmpobjid, 0, 3820, "boxhses_sfsx", "stonewall_la", 0x00000000);
  86. tmpobjid = CreateDynamicObjectEx(19454, 1384.633422, -1902.555908, 14.741823, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  87. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  88. tmpobjid = CreateDynamicObjectEx(19454, 1394.273681, -1902.555908, 14.741823, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  89. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  90. tmpobjid = CreateDynamicObjectEx(19454, 1394.273681, -1902.555908, 11.271829, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  91. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  92. tmpobjid = CreateDynamicObjectEx(19454, 1384.643676, -1902.555908, 11.271829, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  93. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  94. tmpobjid = CreateDynamicObjectEx(19454, 1397.965209, -1897.705444, 14.741823, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  95. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  96. tmpobjid = CreateDynamicObjectEx(19454, 1397.965209, -1897.705444, 11.261828, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  97. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  98. tmpobjid = CreateDynamicObjectEx(19454, 1397.965209, -1888.095825, 11.261828, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  99. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  100. tmpobjid = CreateDynamicObjectEx(19454, 1397.965209, -1888.095825, 14.691824, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  101. SetDynamicObjectMaterial(tmpobjid, 0, 3314, "ce_burbhouse", "sw_wallbrick_06", 0x00000000);
  102. tmpobjid = CreateDynamicObjectEx(18765, 1392.901367, -1898.436523, 10.013033, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  103. SetDynamicObjectMaterial(tmpobjid, 0, 3980, "cityhall_lan", "man_cellarfloor128", 0x00000000);
  104. tmpobjid = CreateDynamicObjectEx(18765, 1392.901367, -1893.975585, 10.033034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  105. SetDynamicObjectMaterial(tmpobjid, 0, 3980, "cityhall_lan", "man_cellarfloor128", 0x00000000);
  106. tmpobjid = CreateDynamicObjectEx(18765, 1384.813476, -1893.975585, 10.043034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  107. SetDynamicObjectMaterial(tmpobjid, 0, 3980, "cityhall_lan", "man_cellarfloor128", 0x00000000);
  108. tmpobjid = CreateDynamicObjectEx(18765, 1384.819824, -1898.436523, 10.023034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  109. SetDynamicObjectMaterial(tmpobjid, 0, 3980, "cityhall_lan", "man_cellarfloor128", 0x00000000);
  110. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  111. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  112. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  113. tmpobjid = CreateDynamicObjectEx(19817, 1390.739624, -1897.406372, 11.723031, 0.000000, 0.000000, 270.000000, 300.00, 300.00);
  114. tmpobjid = CreateDynamicObjectEx(19922, 1395.502807, -1893.162719, 12.543034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  115. tmpobjid = CreateDynamicObjectEx(19922, 1390.382812, -1893.162719, 12.543034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  116. tmpobjid = CreateDynamicObjectEx(19922, 1385.313110, -1893.162719, 12.543034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  117. tmpobjid = CreateDynamicObjectEx(1558, 1388.249755, -1893.294067, 13.103035, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  118. tmpobjid = CreateDynamicObjectEx(1002, 1382.219970, -1892.332519, 14.753036, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  119. tmpobjid = CreateDynamicObjectEx(1002, 1382.219970, -1892.332519, 13.643034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  120. tmpobjid = CreateDynamicObjectEx(1002, 1382.219970, -1892.332519, 15.643037, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  121. tmpobjid = CreateDynamicObjectEx(1025, 1386.739868, -1892.283935, 15.213042, 0.000000, 0.000000, 630.000000, 300.00, 300.00);
  122. tmpobjid = CreateDynamicObjectEx(1074, 1390.448120, -1902.329345, 12.983040, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  123. tmpobjid = CreateDynamicObjectEx(1081, 1389.068481, -1902.329956, 12.993043, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  124. tmpobjid = CreateDynamicObjectEx(1085, 1388.067993, -1902.299682, 12.963041, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  125. tmpobjid = CreateDynamicObjectEx(1081, 1392.288452, -1902.329956, 12.993043, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  126. tmpobjid = CreateDynamicObjectEx(1050, 1383.188964, -1902.334350, 13.573834, -21.100002, 0.000000, 178.299987, 300.00, 300.00);
  127. tmpobjid = CreateDynamicObjectEx(1050, 1383.124389, -1902.482421, 14.266504, -21.100002, 0.000000, 178.299987, 300.00, 300.00);
  128. tmpobjid = CreateDynamicObjectEx(1131, 1396.234985, -1901.480102, 11.807559, -9.799998, 0.000000, 90.000000, 300.00, 300.00);
  129. tmpobjid = CreateDynamicObjectEx(1131, 1396.234985, -1899.169799, 11.807559, -9.799998, 0.000000, 90.000000, 300.00, 300.00);
  130. tmpobjid = CreateDynamicObjectEx(1154, 1396.664672, -1892.615234, 13.793032, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  131. tmpobjid = CreateDynamicObjectEx(1159, 1391.393066, -1892.924438, 13.793039, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  132. tmpobjid = CreateDynamicObjectEx(1193, 1386.333496, -1902.320434, 14.333034, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  133. tmpobjid = CreateDynamicObjectEx(1193, 1390.173583, -1902.320434, 14.853034, 0.000000, 0.000000, 180.000000, 300.00, 300.00);
  134. tmpobjid = CreateDynamicObjectEx(19917, 1383.312377, -1892.872070, 12.563035, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  135. tmpobjid = CreateDynamicObjectEx(19917, 1382.242675, -1892.872070, 12.563035, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  136. tmpobjid = CreateDynamicObjectEx(19900, 1397.539794, -1894.705200, 12.543034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  137. tmpobjid = CreateDynamicObjectEx(19900, 1397.539794, -1895.335327, 12.543034, 0.000000, 0.000000, 0.000000, 300.00, 300.00);
  138. tmpobjid = CreateDynamicObjectEx(19815, 1397.855346, -1897.501342, 14.603039, 0.000000, 0.000000, 270.000000, 300.00, 300.00);
  139. tmpobjid = CreateDynamicObjectEx(19425, 1379.713500, -1893.933959, 12.495662, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  140. tmpobjid = CreateDynamicObjectEx(19425, 1379.713500, -1897.234252, 12.495662, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  141. tmpobjid = CreateDynamicObjectEx(19425, 1379.713500, -1897.234252, 12.495662, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  142. tmpobjid = CreateDynamicObjectEx(19425, 1379.713500, -1900.514770, 12.495662, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  143. tmpobjid = CreateDynamicObjectEx(19425, 1379.713500, -1903.765136, 12.495662, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  144. tmpobjid = CreateDynamicObjectEx(1684, 1369.098388, -1893.330932, 14.005489, 0.000000, 0.000000, 90.000000, 300.00, 300.00);
  145.  
  146. SetTimer("proveriGo", 1000, true);
  147.  
  148. return 1;
  149. }
  150. //------------------------------------------------------------------------------
  151. public OnPlayerConnect(playerid) {
  152. Sirabotam[playerid] = -1;
  153. Davamdel[playerid] = 0;
  154. Checkpoint[playerid] = -1;
  155. Imamdelovi[playerid] = 0;
  156.  
  157. InfoTD = CreatePlayerTextDraw(playerid, 173.821395, 374.500091, "");
  158. PlayerTextDrawLetterSize(playerid, InfoTD, 0.256500, 1.279167);
  159. PlayerTextDrawAlignment(playerid, InfoTD, 1);
  160. PlayerTextDrawColor(playerid, InfoTD, -1);
  161. PlayerTextDrawSetShadow(playerid, InfoTD, 0);
  162. PlayerTextDrawSetOutline(playerid, InfoTD, 1);
  163. PlayerTextDrawBackgroundColor(playerid, InfoTD, 51);
  164. PlayerTextDrawFont(playerid, InfoTD, 1);
  165. PlayerTextDrawSetProportional(playerid, InfoTD, 1);
  166.  
  167. RemoveBuildingForPlayer(playerid, 3744, 2241.2969, -2183.9766, 15.1016, 0.25);
  168. RemoveBuildingForPlayer(playerid, 3744, 2226.3203, -2168.9922, 15.1016, 0.25);
  169. RemoveBuildingForPlayer(playerid, 1226, 2224.7813, -2185.7422, 16.3516, 0.25);
  170. RemoveBuildingForPlayer(playerid, 3574, 2226.3203, -2168.9922, 15.1016, 0.25);
  171. RemoveBuildingForPlayer(playerid, 3574, 2241.2969, -2183.9766, 15.1016, 0.25);
  172. return 1;
  173. }
  174. //------------------------------------------------------------------------------
  175. public OnPlayerDeath(playerid, killerid, reason) {
  176. Stopiramrabota(playerid);
  177. return 1;
  178. }
  179. //------------------------------------------------------------------------------
  180. public OnPlayerCommandText(playerid, cmdtext[]) {
  181. if(strcmp("/zavrsisorabota", cmdtext, true, 10) == 0)
  182. {
  183. if(Sirabotam[playerid] == -1) return 1;
  184. DisablePlayerCheckpoint(playerid);
  185. Sirabotam[playerid] = -1;
  186. Davamdel[playerid] = 0;
  187. Checkpoint[playerid] = -1;
  188. Imamdelovi[playerid] = 0;
  189. if(Vehicle[playerid] != -1) SetVehicleToRespawn(Vehicle[playerid]);
  190. Vehicle[playerid] = -1;
  191. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}Prestanavte so rabota...");
  192. if(Vremeto[playerid] >= 1) { Vremeto[playerid] = -1; PlayerTextDrawHide(playerid, InfoTD); }
  193. return 1;
  194. }
  195. return 0;
  196. }
  197. //------------------------------------------------------------------------------
  198. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
  199. if(vehicleid == Vozilata[0] || vehicleid == Vozilata[1] || vehicleid == Vozilata[2] || vehicleid == Vozilata[3] || vehicleid == Vozilata[4] || vehicleid == Vozilata[5]) {
  200. if(Sirabotam[playerid] == -1) {
  201. new Float: Position[3];
  202. GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  203. SetPlayerPos(playerid, Position[0], Position[1], Position[2]+1);
  204. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}Ne ste prenesuvac na Avto Delovi!");
  205. }
  206. else {
  207. if(Vremeto[playerid] >= 1) { Vremeto[playerid] = -1; PlayerTextDrawHide(playerid, InfoTD); }
  208. }
  209. }
  210. return 1;
  211. }
  212. //------------------------------------------------------------------------------
  213. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  214. new string[256];
  215. if(newkeys == KEY_NO) {
  216. if(Sirabotam[playerid] == -1) return 1;
  217. if(IsPlayerInAnyVehicle(playerid)) return 1;
  218. if(Vehicle[playerid] == -1 && Sirabotam[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "{FFFFFF} Morate da ste vo voziloto za da gi odnesete avto delovite.");
  219. if(CheckPlayerDistanceToVehicle(5.0, playerid, Vehicle[playerid])) {
  220. RemovePlayerAttachedObject(playerid, 5);
  221. if(Imamdelovi[playerid] == 0) return 1;
  222. if(ImaDel[playerid] == -1) {
  223. ImaDel[playerid] = 1;
  224. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  225. new rand = random(4), delovibe;
  226. if(rand == 0) delovibe = 1098;
  227. else if(rand == 1) delovibe = 1128;
  228. else if(rand == 2) delovibe = 1150;
  229. else if(rand == 3) delovibe = 1147;
  230. else if(rand == 4) delovibe = 1078;
  231. SetPlayerAttachedObject( playerid, 5, delovibe, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
  232. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}* Od voziloto zemavte Avto Del!");
  233. }
  234. else if(ImaDel[playerid] == 1) {
  235. ImaDel[playerid] = -1;
  236. RemovePlayerAttachedObject(playerid, 5);
  237. SetPlayerSpecialAction(playerid, 0);
  238. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}* Stavivte avto del vo voziloto!");
  239. if(Imamdelovi[playerid] < 9 && Checkpoint[playerid] == -1) {
  240. format(string, sizeof(string), "{CC0000}Dali ke zemate uste avto delovi vie vekje imate %d avto dela{FFFFFF}.", Imamdelovi[playerid]);
  241. ShowPlayerDialog(playerid, DIALOG_STATUS1, DIALOG_STYLE_MSGBOX, " ", string, "{CC0000}Da", "{CC0000}Ne");
  242. }
  243. if(Davamdel[playerid] == 10) {
  244. format(string, sizeof(string), "{CC0000}Cestitame, {FFFFFF}%s{CC0000}!\nGotovi ste!", GetName(playerid));
  245. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " ", string, "{CC0000}Potvrdi", "");
  246. new rand = random(sizeof(Nosenje));
  247. SetPlayerCheckpoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2], 2.0);
  248. format(string, sizeof(string), " %d Dalecina: %0.2fm", Davamdel[playerid], GetPlayerDistanceFromPoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2]));
  249.  
  250. SendClientMessage(playerid, 0xFFFF00FF, string);
  251. Checkpoint[playerid] = 1;
  252. }
  253. }
  254. }
  255. else if(IsPlayerInRangeOfPoint(playerid, 5.0,1388.4351,-1901.9576,13.5230) || IsPlayerInRangeOfPoint(playerid, 5.0,1391.6552,-1902.1147,13.5213)
  256. || IsPlayerInRangeOfPoint(playerid, 5.0,1389.9698,-1894.3809,13.5330) || IsPlayerInRangeOfPoint(playerid, 5.0,1395.5997,-1901.3136,13.5137)) {
  257. if(Davamdel[playerid] == 5) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000} Vo voziloto mozete da stavite maksimum (4) avto dela.");
  258. if(ImaDel[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000} Vekje drzite vo vasite race avto del!");
  259. Davamdel[playerid] ++;
  260. Imamdelovi[playerid] ++;
  261. new rand = random(4), delovibe;
  262. if(rand == 0) delovibe = 1098;
  263. else if(rand == 1) delovibe = 1128;
  264. else if(rand == 2) delovibe = 1150;
  265. else if(rand == 3) delovibe = 1147;
  266. else if(rand == 4) delovibe = 1078;
  267. SetPlayerAttachedObject( playerid, 5, delovibe, 1, 0.179536, 0.436568, -0.047055, 0.000000, 84.821968, 77.998138, 0.405070, 1.000000, 0.225547 );
  268. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  269. ImaDel[playerid] = 1;
  270. }
  271. }
  272. return 1;
  273. }
  274. //------------------------------------------------------------------------------
  275. public OnPlayerExitVehicle(playerid, vehicleid) {
  276. if(Sirabotam[playerid] == 1 && Imamdelovi[playerid] >= 1 && vehicleid == Vozilata[0] || vehicleid == Vozilata[1] || vehicleid == Vozilata[2] || vehicleid == Vozilata[3] || vehicleid == Vozilata[4] || vehicleid == Vozilata[5] && Davamdel[playerid] != 0) {
  277. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}Imate edna minuta da gi odnesete !");
  278. Vremeto[playerid] = 60;
  279. PlayerTextDrawShow(playerid, InfoTD);
  280. }
  281. return 1;
  282. }
  283. //------------------------------------------------------------------------------
  284. public OnPlayerStateChange(playerid, newstate, oldstate) {
  285. if(newstate == PLAYER_STATE_DRIVER) {
  286. new vehicleid = GetPlayerVehicleID(playerid);
  287. if(vehicleid == Vozilata[0] || vehicleid == Vozilata[1] || vehicleid == Vozilata[2] || vehicleid == Vozilata[3] || vehicleid == Vozilata[4] || vehicleid == Vozilata[5] && Davamdel[playerid] == 0) {
  288. if(Imamdelovi[playerid] != 0) return 1;
  289. Vehicle[playerid] = vehicleid;
  290. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}Odete na checkpoint za da zemete avto del!");
  291. SetPlayerCheckpoint(playerid, 1382.2131,-1897.2834,13.5430, 8.0);
  292. Checkpoint[playerid] = 3;
  293. }
  294. }
  295. return 1;
  296. }
  297. //------------------------------------------------------------------------------
  298. public OnPlayerEnterCheckpoint(playerid) {
  299. new string[256];
  300. if(Checkpoint[playerid] == 1) {
  301. if(ImaDel[playerid] == -1) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000}Vie nemate avto del vo vasite ..!");
  302. DisablePlayerCheckpoint(playerid);
  303. SetPlayerSpecialAction(playerid, 0);
  304. Davamdel[playerid] --;
  305. ImaDel[playerid] = -1;
  306. RemovePlayerAttachedObject(playerid, 5);
  307. new rand = random(sizeof(Nosenje));
  308. SetPlayerCheckpoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2], 2.0);
  309. if(Davamdel[playerid] != 0) {
  310. Checkpoint[playerid] = 1;
  311. format(string, sizeof(string), "{CC0000}Imate uste %d avto delovi da istovarite! Dalecina: %0.2fm", Davamdel[playerid], GetPlayerDistanceFromPoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2]));
  312. SendClientMessage(playerid, 0xFFFF00FF, string);
  313. }
  314. if(Davamdel[playerid] == 0) {
  315. Davamdel[playerid] = -1;
  316. DisablePlayerCheckpoint(playerid);
  317. SetPlayerCheckpoint(playerid, 1371.9376,-1891.6653,13.5005, 9.0);
  318. Checkpoint[playerid] = 2;
  319. format(string, sizeof(string), "{FFFFFF}Odete po isplata!", GetName(playerid));
  320. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " ", string, "{CC0000}Potvrdi", "");
  321. }
  322. return 1;
  323. }
  324. if(Checkpoint[playerid] == 2) {
  325. if(IsPlayerInVehicle(playerid, Vehicle[playerid])) SetVehicleToRespawn(Vehicle[playerid]);
  326. DisablePlayerCheckpoint(playerid);
  327. new money = 1000 + random(500) * Imamdelovi[playerid];
  328. format(string, sizeof(string), "{CC0000}Vie dostavivte %d avto delovi.", Imamdelovi[playerid]);
  329. SendClientMessage(playerid, 0x25B336FF, string);
  330. format(string, sizeof(string), "{CC0000}Zarabotivte $%d.", money);
  331. SendClientMessage(playerid, 0x25B336FF, string);
  332. GivePlayerMoney(playerid, money);
  333. Imamdelovi[playerid] = 0;
  334. Checkpoint[playerid] = -1;
  335. Sirabotam[playerid] = -1;
  336. return 1;
  337. }
  338. if(Checkpoint[playerid] == 3) {
  339. DisablePlayerCheckpoint(playerid);
  340. SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000}TinoScript | {FFFFFF} Odete do avto delovite i za zemanje pritisnete N !");
  341. Checkpoint[playerid] = -1;
  342. return 1;
  343. }
  344. return 1;
  345. }
  346. //------------------------------------------------------------------------------
  347. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  348. new string[256];
  349. switch(dialogid) {
  350. case DIALOG_STATUS1: {
  351. if(response) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "{FFFFFF} Zavrsete so zemanje na avto delovi!");
  352. format(string, sizeof(string), "{FFFFFF}Odnesete gi delovite vo mehanicar baza!", GetName(playerid));
  353. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, " ", string, "{CC0000}Potvrdi", "");
  354. new rand = random(sizeof(Nosenje));
  355. SetPlayerCheckpoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2], 2.0);
  356. format(string, sizeof(string), "Imate uste %d avto delovi da istovarite! Dalecina: %0.2fm", Davamdel[playerid], GetPlayerDistanceFromPoint(playerid, Nosenje[rand][0] ,Nosenje[rand][1], Nosenje[rand][2]));
  357. SendClientMessage(playerid, 0xFFFF00FF, string);
  358. Checkpoint[playerid] = 1;
  359. }
  360. case DIALOG_EVEME1: {
  361. if(!response) return 1;
  362. if(Sirabotam[playerid] == 1) return 1;
  363. Sirabotam[playerid] = 1;
  364. Imamdelovi[playerid] = 0;
  365. Davamdel[playerid] = 0;
  366. SetPlayerSkin(playerid, 60);
  367. SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000}TinoScript | {FFFFFF} Vi cestitame {FFFFFF}se zaposlivte kako dostavuvac na avto delovi.");
  368. SendClientMessage(playerid, COLOR_LIGHTGREEN, "{CC0000}TinoScript | {FFFFFF} Vlezete vo edno od kombinjata za da zapocnete so rabota.");
  369. }
  370. }
  371. return 1;
  372. }
  373. //------------------------------------------------------------------------------
  374. public OnPlayerPickUpPickup(playerid, pickupid)
  375. {
  376. if(pickupid == Pickupot) {
  377. if(Sirabotam[playerid] == 1) return 1;
  378. new string[1024];
  379. strcat(string, "{FFFFFF}Dali sakate da se zaposlite kako prenesuvac na Avto Delovi");
  380. ShowPlayerDialog(playerid, DIALOG_EVEME1, DIALOG_STYLE_MSGBOX, " ", string, "{CC0000}Potvrdi", "{CC0000}Izlez");
  381. }
  382. return 1;
  383. }
  384. //------------------------------------------------------------------------------
  385. forward proveriGo();
  386. public proveriGo() {
  387.  
  388. new string[256];
  389. for(new i = 0; i < MAX_PLAYERS; i++) {
  390. if(IsPlayerConnected(i)) {
  391. if(Vremeto[i] >= 1) {
  392. Vremeto[i] --;
  393. format(string, sizeof(string), "Imate %d sekundi da se vratite vo voziloto.", Vremeto);
  394. PlayerTextDrawSetString(i, InfoTD, string);
  395. PlayerTextDrawShow(i, InfoTD);
  396. if(Vremeto[i] == 0) {
  397. Vremeto[i] = -1;
  398. Stopiramrabota(i);
  399. PlayerTextDrawHide(i, InfoTD);
  400. }
  401. }
  402. }
  403. }
  404. return 1;
  405. }
  406. //------------------------------------------------------------------------------
  407. stock Stopiramrabota(playerid) {
  408. if(Sirabotam[playerid] == 1) {
  409. DisablePlayerCheckpoint(playerid);
  410. Sirabotam[playerid] = -1;
  411. Davamdel[playerid] = 0;
  412. Checkpoint[playerid] = -1;
  413. Imamdelovi[playerid] = 0;
  414. SetVehicleToRespawn(Vehicle[playerid]);
  415. Vehicle[playerid] = -1;
  416. SendClientMessage(playerid, COLOR_WHITE, "{CC0000} TinoScript | {FFFFFF}Gi izgubivte Avto Delovite.");
  417. }
  418. return 1;
  419. }
  420. //------------------------------------------------------------------------------
  421. stock GetName(playerid) {
  422. new
  423. pName[MAX_PLAYER_NAME];
  424.  
  425. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  426. return pName;
  427. }
  428. //------------------------------------------------------------------------------
  429. stock CheckPlayerDistanceToVehicle(Float:radi, playerid, vehicleid) {
  430. if(IsPlayerConnected(playerid)) {
  431. new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z;
  432. GetPlayerPos(playerid,PX,PY,PZ);
  433. GetVehiclePos(vehicleid, X,Y,Z);
  434. new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
  435. if(Distance <= radi*radi) return 1;
  436. }
  437. return 0;
  438. }
  439. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Add Comment
Please, Sign In to add comment