Guest User

Untitled

a guest
Jan 30th, 2020
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Problema:Dupa ce termin o misiune(farm/truck si ce mai tine de genu nu ma mai lasa sa iau vehicul imi zice ca job esuat)
  2.  
  3. YCMD:startwork(playerid, params[], help) {
  4. if(PlayerInfo[playerid][pJob] == 11)
  5. return SCM(playerid, -1, "Foloseste /fish pentru a incepe munca la acest job!");
  6.  
  7. if(IsPlayerInAnyVehicle(playerid))
  8. return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
  9.  
  10. if(PlayerInfo[playerid][pJob] == 0)
  11. return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai un job.");
  12.  
  13. if(JobWorking[playerid] == 1)
  14. return SCM(playerid, COLOR_GREY, "Muncesti deja.");
  15.  
  16. if(targetfind[playerid] != -1)
  17. return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  18.  
  19. if(GetPlayerVirtualWorld(playerid) != 0)
  20. return true;
  21.  
  22. if(JobDeelay[playerid][PlayerInfo[playerid][pJob]] != 0 && PlayerInfo[playerid][pAdmin] < 6)
  23. return JobTimeDeelay(playerid);
  24.  
  25. new Float: Pos[3], Float: CarAngle, string[128];
  26. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  27. switch(PlayerInfo[playerid][pJob]) {
  28. case 1: {
  29. if(PlayerToPoint(7, playerid, -372.3956,-1458.6648,25.7209)) {
  30. if(KG[playerid] > 0)
  31. return SCM(playerid, COLOR_GREY, "Ai deja un sac de faina.");
  32.  
  33. if(PlayerInfo[playerid][pCarLic] == 0)
  34. return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus!");
  35.  
  36. JobSeconds[playerid] = 60;
  37. CarAngle = 153.1984;
  38. DisablePlayerCheckpointEx(playerid);
  39. } else {
  40. if(CP[playerid] != 0)
  41. return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  42.  
  43. CP[playerid] = 53;
  44. SCM(playerid, COLOR_GREY, "Nu esti in zona unde poti incepe munca, dute la checkpoint setat de noi.");
  45. SetPlayerCheckpointEx(playerid, -372.3956,-1458.6648,25.7209, 7.0);
  46. return true;
  47. }
  48. }
  49. case 2: {
  50. if(PlayerToPoint(7, playerid, 1636.2758,698.3583,10.8203)) {
  51. if(PlayerInfo[playerid][pCarLic] == 0)
  52. return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus!");
  53.  
  54. CarAngle = 2.3953;
  55. CP[playerid] = 52;
  56. DisablePlayerCheckpointEx(playerid);
  57.  
  58. new szDialog2[400];
  59. strcat(szDialog2, "Category\tType\tSkill\n");
  60. strcat(szDialog2, "Clothes\t{35DE1F}Legal\t1+\n");
  61. strcat(szDialog2, "Food\t{35DE1F}Legal\t1+\n");
  62. strcat(szDialog2, "Furniture\t{35DE1F}Legal\t1+\n");
  63. strcat(szDialog2, "Explosible\t{35DE1F}Legal\t2+\n");
  64. strcat(szDialog2, "Guns\t{F21313}Illegal\t3+\n");
  65. strcat(szDialog2, "Stolen cars\t{F21313}Illegal\t3+\n");
  66. ShowPlayerDialog(playerid, DIALOG_TRUCKER, DIALOG_STYLE_TABLIST_HEADERS, "Choose destination:", szDialog2, "Select", "Cancel");
  67. }
  68. else {
  69. if(CP[playerid] != 0)
  70. return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  71.  
  72. CP[playerid] = 53;
  73. SCM(playerid, COLOR_GREY, "Nu esti in zona unde poti incepe munca, dute la checkpoint setat de noi.");
  74. SetPlayerCheckpointEx(playerid, 1636.2758,698.3583,10.8203, 7.0);
  75. return true;
  76. }
  77. }
  78. case 3: {
  79. if(GetPlayerSkill(playerid) == 1)
  80. PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul public!");
  81.  
  82. else if(GetPlayerSkill(playerid) == 2)
  83. PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul personal descuiat!");
  84.  
  85. else if(GetPlayerSkill(playerid) == 3)
  86. PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul ce apartine unei mafii!");
  87.  
  88. else if(GetPlayerSkill(playerid) == 4)
  89. PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul personal incuiat!");
  90.  
  91. else if(GetPlayerSkill(playerid) == 5)
  92. PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul ce apartine unui departament de politie!");
  93.  
  94. PlayerTextDrawShow(playerid, InfosTD);
  95.  
  96. JobWorking[playerid] = 1;
  97. defer HideTextdraw(playerid);
  98. return true;
  99. }
  100. case 4: {
  101. if(PlayerInfo[playerid][pWantedLevel] != 0)
  102. return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti munci deoarece ai wanted!");
  103.  
  104. if(!PlayerToPoint(10, playerid, 2770.2822,-1610.9043,11.0418)) {
  105. SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
  106. SetPlayerCheckpointEx(playerid, 2770.2822,-1610.9043,11.0418, 10.0);
  107. CP[playerid] = 53;
  108. return true;
  109. }
  110. if(PlayerInfo[playerid][pCarLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus pentru a putea munci la acest job!");
  111. CP[playerid] = 156;
  112. new rand = random(3);
  113. switch(rand) {
  114. case 0: SetPlayerCheckpointEx(playerid, 2790.6213,-2523.6418,13.6704, 5.0);
  115. case 1: SetPlayerCheckpointEx(playerid, 2529.4214,-2009.4240,13.5798, 5.0);
  116. case 2: SetPlayerCheckpointEx(playerid, 2180.0774,-2317.1672,13.5703, 5.0);
  117. case 3: SetPlayerCheckpointEx(playerid, 681.2267,-442.6591,16.3633, 5.0);
  118. }
  119.  
  120. format(string, sizeof(string), "Du-te la checkpoint-ul de pe mapa pentru a livra materialele!");
  121. PlayerTextDrawSetString(playerid, InfosTD, string);
  122. defer HideTextdraw(playerid);
  123. PlayerTextDrawShow(playerid, InfosTD);
  124.  
  125. CarAngle = 277.2561;
  126. StartingWork[playerid] = 0;
  127. CurseFacute[playerid] = 0;
  128. MoneyEarned[playerid] = 0;
  129. }
  130. case 5..6: return true;
  131. case 7: {
  132. if(PlayerToPoint(7, playerid, -2667.0920,270.6440,3.9366)) {
  133. if(PlayerInfo[playerid][pCarLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus pentru a putea munci la acest job!");
  134. CarAngle = 0;
  135. CP[playerid] = 155;
  136. new j = random(housess)+1;
  137. if(j == 0) j = 1;
  138. SetPlayerCheckpointEx(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez], 7.0);
  139. format(string, sizeof(string), "Du-te la punctul ~r~~h~rosu~w~~h~ de pe mapa pentru a livra pizza.~n~Distanta: ~y~%0.1fm.", GetPlayerDistanceFromPoint(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez]));
  140. PlayerTextDrawSetString(playerid, InfosTD, string);
  141. defer HideTextdraw(playerid);
  142. PlayerTextDrawShow(playerid, InfosTD);
  143. }
  144. else {
  145. if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  146. CP[playerid] = 53;
  147. SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
  148. SetPlayerCheckpointEx(playerid,-2667.0920,270.6440,3.9366, 7.0);
  149. return true;
  150. }
  151. }
  152. case 8: {
  153. if(!PlayerToPoint(6, playerid, 2198.6216,929.7672,10.8876)) {
  154. SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
  155. SetPlayerCheckpointEx(playerid, 2198.6216,929.7672,10.8876, 6.0);
  156. CP[playerid] = 53;
  157. return true;
  158. }
  159. if(PlayerInfo[playerid][pCarLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus pentru a putea munci la acest job!");
  160. CP[playerid] = 57;
  161.  
  162. new rand = random(3);
  163. switch(rand) {
  164. case 1: SetPlayerCheckpointEx(playerid, 2118.1729,955.7316,10.5437, 5.0);
  165. case 2: SetPlayerCheckpointEx(playerid, 2117.4365,950.1517,10.5437, 5.0);
  166. case 3: SetPlayerCheckpointEx(playerid, 2118.1729,955.7316,10.5437, 5.0);
  167. default: SetPlayerCheckpointEx(playerid, 2117.4365,950.1517,10.5437, 5.0);
  168. }
  169.  
  170. Pos[0] = 2198.6753;
  171. Pos[1] = 930.3242;
  172. Pos[2] = 10.8888;
  173. CarAngle = 180.7365;
  174.  
  175. PlayerTextDrawSetString(playerid, InfosTD, "Du-te la punctul ~r~rosu~w~~h~ pentru a incarca coletele!");
  176. defer HideTextdraw(playerid);
  177. PlayerTextDrawShow(playerid, InfosTD);
  178. }
  179. case 9: return true;
  180. case 10: {
  181. if(!PlayerToPoint(7, playerid, 981.3931,2162.7891,10.5850)) {
  182. SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
  183. SetPlayerCheckpointEx(playerid, 981.3931,2162.7891,10.5850, 7.0);
  184. CP[playerid] = 53;
  185. return true;
  186. }
  187. if(PlayerInfo[playerid][pCarLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de condus pentru a putea munci la acest job!");
  188. PlayerTextDrawSetString(playerid, InfosTD, "Du-te la ~r~~h~checkpoint-ul~w~~h~ de pe mapa pentru a lua marfa!");
  189. defer HideTextdraw(playerid);
  190. PlayerTextDrawShow(playerid, InfosTD);
  191. DisablePlayerCheckpointEx(playerid);
  192. playerObject[playerid] = CreatePlayerObject(playerid, 1271, 925.8871,2069.3081,10.8203, 0.00000, 0.00000, 45.00000);
  193. SetPlayerCheckpointEx(playerid, 925.8871,2069.3081,10.8203, 2.0);
  194. CP[playerid] = 170;
  195. UpdateJobStats(playerid);
  196. }
  197. }
  198. SetPVarInt(playerid, "InHand", 0);
  199.  
  200. MoneyEarned[playerid] = 0;
  201. CurseFacute[playerid] = 0;
  202. if(PlayerInfo[playerid][pShowJob] == 0 && PlayerInfo[playerid][pJob] != 5 && PlayerInfo[playerid][pLevel] < 3) SCM(playerid, COLOR_YELLOW, "Daca doresti sa vezi mai multe informatii folositoare de la job, o poti face prin comanda (/hud > Informatii job).");
  203. new skill = GetPlayerSkill(playerid);
  204. switch(skill) {
  205. case 1: JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill1Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1, 0);
  206. case 2: JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill2Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1, 0);
  207. case 3: JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill3Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1, 0);
  208. case 4: JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill4Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1, 0);
  209. case 5: JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill5Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1, 0);
  210. }
  211. PutPlayerInVehicleEx(playerid, JobVehicle[playerid], 0);
  212. JobWorking[playerid] = 1;
  213.  
  214. if(PlayerInfo[playerid][pJob] != 2)
  215. UpdateJobStats(playerid);
  216.  
  217. Gas[JobVehicle[playerid]] = 100;
  218. WorkingTime[playerid] = 0;
  219.  
  220. SetPlayerVirtualWorld(playerid, 0);
  221.  
  222. new engine,lights,alarm,doors,bonnet,boot,objective;
  223. vehEngine[JobVehicle[playerid]] = 1;
  224. GetVehicleParamsEx(JobVehicle[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
  225. SetVehicleParamsEx(JobVehicle[playerid],VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  226. return true;
  227. }
  228.  
  229. function CheckSeconds(playerid) {
  230. if(GetTickCount() - JobTime[playerid] < 3500) {
  231. if(InDealer[playerid] == 1) return true;
  232. if(UsedFind[playerid] == 1) return true;
  233. if(CP[playerid] == 57 && JobWorking[playerid] == 1) return true;
  234. if(PlayerToPoint(20, playerid, CheckpointPos[playerid][0], CheckpointPos[playerid][1], CheckpointPos[playerid][2]) && JobWorking[playerid] == 1) return true;
  235. if(PlayerToPoint(100, playerid, LastPos[playerid][0], LastPos[playerid][1], LastPos[playerid][2]) && JobWorking[playerid] == 0) return true;
  236. if(ServerSystem[4] == 0) NightBot(playerid, "Cheats (teleport-hack)");
  237. WTimes[playerid] += 2;
  238. }
  239. return true;
  240. }
  241.  
  242.  
  243.  
  244.  
  245. comanda work
  246.  
  247.  
  248. Problema:Dupa ce termin o misiune(farm/truck si ce mai tine de genu nu ma mai lasa sa iau vehicul imi zice ca job esuat)
  249.  
  250.  
  251.  
  252. si restu ce mai gasesc cu job esuat ai parasit vehiculul
  253.  
  254.  
  255. if(JobWorking[playerid] == 1 && gLastCar[playerid] == JobVehicle[playerid]) {
  256. if(PlayerInfo[playerid][pJob] == 1) {
  257. SCM(playerid, COLOR_GREY, "Job esuat! Ai parasit vehiculul.");
  258. if(playerObject[playerid] != 0) DestroyPlayerObject(playerid, playerObject[playerid]), playerObject[playerid] = 0;
  259. if(playerObject2[playerid] != 0) DestroyObject(playerObject2[playerid]), playerObject2[playerid] = 0;
  260. JobWorking[playerid] = 0;
  261. PlayerTextDrawHide(playerid, JobTD);
  262. if(JobVehicle[playerid] != 0) { DestroyVehicle(JobVehicle[playerid]); JobVehicle[playerid] = 0; }
  263. if(Trailer[playerid] != 0) { DestroyVehicle(Trailer[playerid]); Trailer[playerid] = 0; }
  264. PlayerTextDrawHide(playerid, InfosTD);
  265. DisablePlayerCheckpointEx(playerid);
  266. DisablePlayerRaceCheckpointEx(playerid);
  267. CP[playerid] = 0;
  268. JobVehicle[playerid] = 0;
  269. RemovePlayerAttachedObject(playerid, 2);
  270. RemovePlayerAttachedObject(playerid, 6);
  271. JobDeelay[playerid][PlayerInfo[playerid][pJob]] = 180;
  272. }
  273. else JobLeftTime[playerid] = 120;
  274. }
  275.  
  276. case DIALOG_TRUCKER: {
  277. if(!response) {
  278. JobWorking[playerid] = 0;
  279. PlayerTextDrawHide(playerid, JobTD);
  280. if(JobVehicle[playerid] != 0) { DestroyVehicle(JobVehicle[playerid]); JobVehicle[playerid] = 0; }
  281. if(Trailer[playerid] != 0) { DestroyVehicle(Trailer[playerid]); Trailer[playerid] = 0; }
  282. PlayerTextDrawHide(playerid, InfosTD);
  283. DisablePlayerCheckpointEx(playerid);
  284. CP[playerid] = 0;
  285. JobVehicle[playerid] = 0;
  286. SCM(playerid, COLOR_GREY, "Job esuat! Ai parasit vehiculul.");
  287. return true;
  288. }
  289. if(JobWorking[playerid] == 0) return true;
  290.  
  291. if(listitem >= 3) {
  292. strcat(string, "Category\tType\tSkill\n");
  293. strcat(string, "Clothes\t{35DE1F}Legal\t1+\n");
  294. strcat(string, "Food\t{35DE1F}Legal\t1+\n");
  295. strcat(string, "Furniture\t{35DE1F}Legal\t1+\n");
  296. strcat(string, "Explosible\t{35DE1F}Legal\t2+\n");
  297. strcat(string, "Guns\t{F21313}Illegal\t3+\n");
  298. strcat(string, "Stolen cars\t{F21313}Illegal\t3+\n");
  299. if(listitem == 3 && GetPlayerSkill(playerid) < 2) return SCM(playerid, COLOR_LGREEN, "Eroare: Pentru a face acel transport ai nevoie de skill 2+!"), ShowPlayerDialog(playerid, DIALOG_TRUCKER, DIALOG_STYLE_TABLIST_HEADERS, "Choose destination", string, "Select", "Cancel");
  300. if(listitem == 4 && GetPlayerSkill(playerid) < 3) return SCM(playerid, COLOR_LGREEN, "Eroare: Pentru a face acel transport ai nevoie de skill 3+!"), ShowPlayerDialog(playerid, DIALOG_TRUCKER, DIALOG_STYLE_TABLIST_HEADERS, "Choose destination", string, "Select", "Cancel");
  301. if(listitem == 5 && GetPlayerSkill(playerid) < 3) return SCM(playerid, COLOR_LGREEN, "Eroare: Pentru a face acel transport ai nevoie de skill 3+!"), ShowPlayerDialog(playerid, DIALOG_TRUCKER, DIALOG_STYLE_TABLIST_HEADERS, "Choose destination", string, "Select", "Cancel");
  302. }
  303.  
  304. CP[playerid] = 52;
  305.  
  306. new Float:pX,Float:pY,Float:pZ,Float:vA;
  307. GetPlayerPos(playerid,pX,pY,pZ);
  308. GetVehicleZAngle(GetPlayerVehicleID(playerid),vA);
  309. switch(listitem) {
  310. case 0: Trailer[playerid] = CreateVehicleEx(435, pX+6, pY+6, pZ+6, vA, -1, -1, -1, 0);
  311. case 2: Trailer[playerid] = CreateVehicleEx(591, pX+6, pY+6, pZ+6, vA, -1, -1, -1, 0);
  312. case 3: {
  313. Trailer[playerid] = CreateVehicleEx(584, pX+6, pY+6, pZ+6, vA, -1, -1, -1, 0);
  314. SetVehicleHealth(Trailer[playerid], 500);
  315. }
  316. default: Trailer[playerid] = CreateVehicleEx(450, pX+6, pY+6, pZ+6, vA, -1, -1, -1, 0);
  317. }
RAW Paste Data