Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.65 KB | None | 0 0
  1. #define POSAO_BOJA "{00C0FF}"
  2. #define DIALOG_PLET 1
  3. // onplayerconnect staviti na 0 posaoprema
  4. new PosaoOprema[MAX_PLAYERS];
  5. //takodjer staviti na 0 onplayerconnect
  6. new LetSF[MAX_PLAYERS];
  7. new LetLV[MAX_PLAYERS];
  8. //
  9. #define POSAO_PILOT 1
  10. //
  11. new ppilot;
  12. //
  13. new vpilot[5];
  14. //
  15. vpilot[0] = AddStaticVehicleEx(519,1992.3000488,-2315.3000488,14.5000000,90.0000000,-1,-1,1000); //Shamal
  16. vpilot[1] = AddStaticVehicleEx(519,1992.3000488,-2381.8000488,14.5000000,90.0000000,-1,-1,1000); //Shamal
  17. vpilot[2] = AddStaticVehicleEx(553,1889.8000488,-2626.5000000,15.6000004,0.0000000,106,1,1000); //Nevada
  18. vpilot[3] = AddStaticVehicleEx(553,1754.0999756,-2625.8000488,15.6000004,0.0000000,106,1,1000); //Nevada
  19. vpilot[4] = AddStaticVehicleEx(553,1617.0999756,-2625.8999023,15.6000004,0.0000000,106,1,1000); //Nevada
  20. //
  21. ppilot = CreateDynamicPickup(1274, 1, 1892.8370,-2328.5259,13.5469); //posao pilot
  22. // ovo pod komandu /komande
  23.  
  24. if (PlayerInfo[playerid][pPosao] == POSAO_PILOT)
  25. {
  26. strcat(info, ""POSAO_BOJA"- Komande posla: /let /oprema\n\n", sizeof(info));
  27. }
  28. return 1;
  29.  
  30. //
  31.  
  32. else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1892.8370,-2328.5259,13.5469))
  33. {
  34. PlayerInfo[playerid][pPosao] = POSAO_PILOT;
  35. SCM(playerid, -1, ""POSAO_BOJA"Uspesno ste se zaposlili kao pilot!");
  36. SCM(playerid, -1, ""POSAO_BOJA"Komande posla: /let");
  37. }
  38. return 1;
  39. //
  40.  
  41. YCMD:let(playerid, params[], help)
  42. {
  43. #pragma unused help
  44. #pragma unused params
  45. if(PlayerInfo[playerid][pPosao] != POSAO_PILOT) return SCM(playerid,-1,""POSAO_BOJA"Niste pilot!");
  46. if(PosaoOprema[playerid] == 0) return SCM(playerid,-1,""POSAO_BOJA"Niste uzeli opremu za posao (/oprema)!");
  47. if(LetSF[playerid] != 0 || LetLV[playerid] != 0) return SCM(playerid,-1,""POSAO_BOJA"Vec imas aktiviran posao!");
  48. if(!PilotVozila(GetPlayerVehicleID(playerid))) return SCM(playerid,-1,""POSAO_BOJA"Niste u avionu!");
  49. SPD(playerid, DIALOG_PLET, DIALOG_STYLE_LIST, ""POSAO_BOJA"Let", ""POSAO_BOJA"(1). "POSAO_BOJA"Let LS - SF\n"POSAO_BOJA"(2). "POSAO_BOJA"Let LS - LV", "Odaberi", "Izlaz");
  50. return 1;
  51. }
  52.  
  53. //pod komandu /oprema
  54.  
  55. else if(PlayerInfo[playerid][pPosao] == POSAO_PILOT)
  56. {
  57. if(PosaoOprema[playerid] == 0)
  58. {
  59. SetPlayerSkin(playerid, 61);
  60. SCM(playerid,-1,""POSAO_BOJA"Uzeli ste opremu za posao, da je skinte kucajte ponovo /oprema!");
  61. PosaoOprema[playerid] = 1;
  62. }
  63. else if(PosaoOprema[playerid] == 1)
  64. {
  65. if(LetSF[playerid] != 0 || LetLV[playerid] != 0) return SCM(playerid, -1, ""POSAO_BOJA""POSAO_BOJA"Imas aktiviran posao!");
  66. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  67. SCM(playerid,-1,""POSAO_BOJA"Skinuli ste opremu za vas posao!");
  68. PosaoOprema[playerid] = 0;
  69. }
  70. }
  71.  
  72. //pod komandu /prekiniposao
  73.  
  74. else if(PlayerInfo[playerid][pPosao] == POSAO_PILOT)
  75. {
  76. if(LetSF[playerid] != 0 || LetLV[playerid] != 0)
  77. {
  78. LetSF[playerid] = 0; LetLV[playerid] = 0;
  79. DisablePlayerCheckpoint(playerid);
  80. SCM(playerid,-1,""POSAO_BOJA"Prekinuli ste sa poslom!");
  81. }
  82. else return SCM(playerid,-1,""POSAO_BOJA"Niste zapoceli sa poslom!");
  83. }
  84.  
  85. //ovo ako udje u vozilo a nije pilot da ga izbaci
  86.  
  87. if(PilotVozila(vozilo))
  88. {
  89. if(PlayerInfo[playerid][pPosao] != POSAO_PILOT)
  90. {
  91. SCM(playerid, -1, ""POSAO_BOJA"Niste zaposleni kao pilot!");
  92. RemovePlayerFromVehicle(playerid);
  93. }
  94. else return SCM(playerid, -1, ""POSAO_BOJA"Komande posla: /let /oprema");
  95. }
  96.  
  97. //on player enter checkpoint
  98.  
  99. ////////////////////////////////PILOT LET LV/////////////////////////////////////////
  100. if(LetLV[playerid] == 1 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  101. {
  102. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1847.4221,-2414.0798,13.5547))
  103. {
  104. TogglePlayerControllable(playerid, 0);
  105. GameTextForPlayer(playerid, "~b~sacekajte...", 5000, 3);
  106. utovar[playerid] = SetTimerEx("preposta", 5000, false, "d", playerid);
  107. SetPlayerCheckpoint(playerid, 1477.5233,1395.1841,10.8203, 5.0);
  108. LetLV[playerid] = 2;
  109. }
  110. }
  111. if(LetLV[playerid] == 2 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  112. {
  113. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1477.5233,1395.1841,10.8203))
  114. {
  115. TogglePlayerControllable(playerid, 0);
  116. GameTextForPlayer(playerid, "~b~sacekajte...", 5000, 3);
  117. utovar[playerid] = SetTimerEx("preposta", 5000, false, "d", playerid);
  118. SetPlayerCheckpoint(playerid, 1879.6438,-2493.6636,13.5547, 5.0);
  119. LetLV[playerid] = 3;
  120. }
  121. }
  122. if(LetLV[playerid] == 3 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  123. {
  124. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1879.6438,-2493.6636,13.5547))
  125. {
  126. new bonus = random(400), string[120];
  127. g_NovacPlus(playerid, 1600+bonus);
  128. format(string,sizeof(string),""POSAO_BOJA"Uspesno ste zavrsili prevoz putnika!\n\n"POSAO_BOJA"Plata: "POSAO_BOJA"1500$\n"POSAO_BOJA"Bonus: "POSAO_BOJA"%d$",bonus);
  129. ShowPlayerDialog(playerid,DIALOG_ISPLATA,DIALOG_STYLE_MSGBOX,"Kraj prevoza putnika",string,"Ok","");
  130. LetLV[playerid] = 0; DisablePlayerCheckpoint(playerid);
  131. }
  132. }
  133. ///////////////////////////////PILOT LET SF/////////////////////////////////////////
  134. if(LetSF[playerid] == 1 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  135. {
  136. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1847.4221,-2414.0798,13.5547))
  137. {
  138. TogglePlayerControllable(playerid, 0);
  139. GameTextForPlayer(playerid, "~b~sacekajte...", 5000, 3);
  140. utovar[playerid] = SetTimerEx("preposta", 5000, false, "d", playerid);
  141. SetPlayerCheckpoint(playerid, -1506.8629,-14.1312,14.1409, 5.0);
  142. LetSF[playerid] = 2;
  143. }
  144. }
  145. if(LetSF[playerid] == 2 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  146. {
  147. if(IsPlayerInRangeOfPoint(playerid, 5.0, -1506.8629,-14.1312,14.1409))
  148. {
  149. TogglePlayerControllable(playerid, 0);
  150. GameTextForPlayer(playerid, "~b~sacekajte...", 5000, 3);
  151. utovar[playerid] = SetTimerEx("preposta", 5000, false, "d", playerid);
  152. SetPlayerCheckpoint(playerid, 1879.6438,-2493.6636,13.5547, 5.0);
  153. LetSF[playerid] = 3;
  154. }
  155. }
  156. if(LetSF[playerid] == 3 && PilotVozila(CID) && GetPlayerState(playerid) == 2)
  157. {
  158. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1879.6438,-2493.6636,13.5547))
  159. {
  160. new bonus = random(200), string[120];
  161. g_NovacPlus(playerid, 1500+bonus);
  162. format(string,sizeof(string),""POSAO_BOJA"Uspesno ste zavrsili prevoz putnika!\n\n"POSAO_BOJA"Plata: "POSAO_BOJA"1500$\n"POSAO_BOJA"Bonus: "POSAO_BOJA"%d$",bonus);
  163. ShowPlayerDialog(playerid,DIALOG_ISPLATA,DIALOG_STYLE_MSGBOX,"Kraj prevoza putnika",string,"Ok","");
  164. LetSF[playerid] = 0; DisablePlayerCheckpoint(playerid);
  165. }
  166. }
  167.  
  168. //dialog
  169.  
  170. if(dialogid == DIALOG_PLET)
  171. {
  172. if(!response) return 1;
  173. switch(listitem)
  174. {
  175. case 0:
  176. {
  177. if(PilotVozila(GetPlayerVehicleID(playerid)))
  178. {
  179. SetPlayerCheckpoint(playerid, 1847.4221,-2414.0798,13.5547, 5.0);
  180. LetSF[playerid] = 1; SCM(playerid,-1,""POSAO_BOJA"Krenuli ste sa poslom, prevozite putnike u SF!");
  181. }
  182. else return SCM(playerid,-1,""POSAO_BOJA"Niste u avionu!");
  183. }
  184. case 1:
  185. {
  186. if(PilotVozila(GetPlayerVehicleID(playerid)))
  187. {
  188. SetPlayerCheckpoint(playerid, 1847.4221,-2414.0798,13.5547, 5.0);
  189. LetLV[playerid] = 1; SCM(playerid,-1,""POSAO_BOJA"Krenuli ste sa poslom, prevozite putnike u LV!");
  190. }
  191. else return SCM(playerid,-1,""POSAO_BOJA"Niste u avionu!");
  192. }
  193. }
  194. }
  195.  
  196. //
  197.  
  198. stock PosaoIme(id)
  199. {
  200. new posao[32];
  201. if(id == 0) posao = "Nezaposlen";
  202. else if(id == 1) posao = "Pilot";
  203. return posao;
  204. }
  205.  
  206. //
  207.  
  208. stock PilotVozila(carid)
  209. {
  210. for(new i = 0; i < sizeof(vpilot); i++)
  211. {
  212. if(carid == vpilot[i]) return 1;
  213. }
  214. return 0;
  215. }
  216.  
  217. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement