Advertisement
Guest User

Muncitor de Cariera B-Zone

a guest
Nov 21st, 2020 (edited)
378
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static Text:Quarry[4], PlayerText:PlayerQuarry[5];
  2. static CarSkillQuarry[7];
  3. static QuarryCP[MAX_PLAYERS], CP[MAX_PLAYERS];
  4. static checkcar[MAX_PLAYERS];
  5. new Iterator:Quarryplayers<MAX_PLAYERS>;
  6.  
  7. enum pInfo
  8. {
  9.  pSkill, pLoads, pEarned, pTure, pJob
  10. }
  11. new PlayerInfo[MAX_PLAYERS][pInfo];
  12.  
  13. AddStaticPickup(1239, 20, 816.6284,856.8055,12.7891, 0); // Muncitor de cariera //
  14. Create3DTextLabel("Muncitor de cariera\nType /getjob to get this job", -1, 816.6284,856.8055,12.7891, 10.0, 0);
  15.  
  16. stock LOADTD()
  17. {
  18.     Quarry[0] = TextDrawCreate(425.200073, 348.293273, "Go into the checkpoint to start working.");
  19.     TextDrawLetterSize(Quarry[0], 0.359200, 1.301333);
  20.     TextDrawAlignment(Quarry[0], 3);
  21.     TextDrawColor(Quarry[0], -1);
  22.     TextDrawSetShadow(Quarry[0], 0);
  23.     TextDrawBackgroundColor(Quarry[0], 255);
  24.     TextDrawFont(Quarry[0], 1);
  25.     TextDrawSetProportional(Quarry[0], 1);
  26.  
  27.     Quarry[1] = TextDrawCreate(416.400024, 325.893310, "box");
  28.     TextDrawLetterSize(Quarry[1], 0.000000, 2.160001);
  29.     TextDrawTextSize(Quarry[1], 625.000000, 0.000000);
  30.     TextDrawAlignment(Quarry[1], 1);
  31.     TextDrawColor(Quarry[1], -1);
  32.     TextDrawUseBox(Quarry[1], 1);
  33.     TextDrawBoxColor(Quarry[1], 159);
  34.     TextDrawSetShadow(Quarry[1], 0);
  35.     TextDrawBackgroundColor(Quarry[1], 255);
  36.     TextDrawFont(Quarry[1], 1);
  37.     TextDrawSetProportional(Quarry[1], 1);
  38.  
  39.     Quarry[2] = TextDrawCreate(458.800048, 359.493225, "Masina este incarcata.Mergi inapoi pentru a primii banii");
  40.     TextDrawLetterSize(Quarry[2], 0.359200, 1.301333);
  41.     TextDrawAlignment(Quarry[2], 3);
  42.     TextDrawColor(Quarry[2], -1);
  43.     TextDrawSetShadow(Quarry[2], 0);
  44.     TextDrawBackgroundColor(Quarry[2], 255);
  45.     TextDrawFont(Quarry[2], 1);
  46.     TextDrawSetProportional(Quarry[2], 1);
  47.  
  48.     Quarry[3] = TextDrawCreate(282.000091, 119.813308, "~y~332$");
  49.     TextDrawLetterSize(Quarry[3], 0.572000, 2.473598);
  50.     TextDrawAlignment(Quarry[3], 1);
  51.     TextDrawColor(Quarry[3], -1);
  52.     TextDrawSetShadow(Quarry[3], 0);
  53.     TextDrawBackgroundColor(Quarry[3], 255);
  54.     TextDrawFont(Quarry[3], 2);
  55.     TextDrawSetProportional(Quarry[3], 1);
  56.     return 1;
  57. }
  58.  
  59. public OnPlayerEnterCheckpoint(playerid)
  60. {
  61.     if(CP[playerid] == 1){
  62.     CP[playerid] = 2;
  63.     DisablePlayerCheckpoint(playerid);
  64.     return 1;
  65.     }
  66. if(QuarryCP[playerid] == 1)
  67.     {
  68.     QuarryCP[playerid] = 2;
  69.     SetPlayerCheckpoint(playerid, 638.9249,857.2787,-40.2326, 5);
  70.     TextDrawHideForPlayer(playerid, Quarry[0]);
  71.     return 1;
  72.     }
  73.     if(QuarryCP[playerid] == 2)
  74.     {
  75.     QuarryCP[playerid] = 3;
  76.     SetPlayerCheckpoint(playerid, 839.2156,885.3904,13.3516, 5);
  77.     TextDrawShowForPlayer(playerid, Quarry[2]);
  78.     return 1;
  79.     }
  80.     if(QuarryCP[playerid] == 3)
  81.     {
  82.     new info[100];
  83.     QuarryCP[playerid] = 4;
  84.     new vehnev, Float:GetVehHp;
  85.     GetVehicleHealth(playerid, GetVehHp);
  86.     new rand = 200+ random(300);
  87.     GivePlayerCash(playerid, rand);
  88.     PlayerInfo[playerid][pMoney] += rand;
  89.     format(info, sizeof(info), "~y~%d$", rand);
  90.     PlayerInfo[playerid][pTure] += 1;
  91.     PlayerInfo[playerid][pEarned] += rand;
  92.     PlayerInfo[playerid][pLoads] += 1;
  93.     TextDrawSetString(Quarry[3], info);
  94.     SetPlayerCheckpoint(playerid, 537.5002,846.5444,-42.1651, 5);
  95.     TextDrawShowForPlayer(playerid, Quarry[3]);
  96.     TextDrawHideForPlayer(playerid, Quarry[2]);
  97.     vehnev = 0;
  98.     SCMF(playerid, COLOR_GREY, "Castig:%d$", rand);
  99.     if(GetVehHp > 990.0)
  100.     {
  101.     vehnev = 1;
  102.     PlayerInfo[playerid][pMoney] += 100;
  103.     SCM(playerid, COLOR_GREY, "Bonus vehicul nelovit:100$");
  104.     GivePlayerCash(playerid, 100);
  105.     }
  106.     if(GetVehHp < 990.0)
  107.     {
  108.     vehnev = 0;
  109.     SCM(playerid, COLOR_GREY, "Bonus vehicule nelovit:0$");
  110.     }
  111.     if(vehnev == 1){
  112.     SCMF(playerid, COLOR_GREY, "Total:%d", rand+100);}
  113.     if(vehnev == 0){
  114.     SCMF(playerid, COLOR_GREY, "Total:%d", rand);}
  115.     defer HideMoney(playerid);
  116.     if(PlayerInfo[playerid][pTure] == 30)
  117.     {
  118.     PlayerInfo[playerid][pSkill] = 2;
  119.     SendClientMessage(playerid, COLOR_YELLOW, "Felicitari, ai atins skill-ul 2 la jobul muncitor de cariera!");
  120.     }
  121.     if(PlayerInfo[playerid][pTure] == 60)
  122.     {
  123.     PlayerInfo[playerid][pSkill] = 2;
  124.     SendClientMessage(playerid, COLOR_YELLOW, "Felicitari, ai atins skill-ul 3 la jobul muncitor de cariera!");
  125.     }
  126.     return 1;
  127.     }
  128.     if(QuarryCP[playerid] == 4)
  129.     {
  130.     QuarryCP[playerid] = 5;
  131.     TextDrawHideForPlayer(playerid, Quarry[2]);
  132.     SetPlayerCheckpoint(playerid, 575.1714,926.8302,-42.9609, 5);
  133.     return 1;
  134.     }
  135.     if(QuarryCP[playerid] == 5)
  136.     {
  137.     QuarryCP[playerid] = 6;
  138.     TextDrawShowForPlayer(playerid, Quarry[2]);
  139.     SetPlayerCheckpoint(playerid, 839.2156,885.3904,13.3516, 5);
  140.     return 1;
  141.     }
  142.     if(QuarryCP[playerid] == 6)
  143.     {
  144.     new info[100];
  145.     QuarryCP[playerid] = 1;
  146.     new rand = 200+ random(300);
  147.     new vehnev, Float:GetVehHp;
  148.     new carcheck = GetPlayerVehicleID(playerid);
  149.     if(carcheck == CarSkillQuarry[1] || CarSkillQuarry[2] || CarSkillQuarry[3])
  150.     {
  151.     GetVehicleHealth(playerid, GetVehHp);
  152.     }
  153.     GivePlayerCash(playerid, rand);
  154.     PlayerInfo[playerid][pMoney] += rand;
  155.     format(info, sizeof(info), "~y~%d$", rand);
  156.     PlayerInfo[playerid][pTure] += 1;
  157.     PlayerInfo[playerid][pEarned] += rand;
  158.     PlayerInfo[playerid][pLoads] += 1;
  159.     TextDrawSetString(Quarry[3], info);
  160.     TextDrawShowForPlayer(playerid, Quarry[3]);
  161.     TextDrawHideForPlayer(playerid, Quarry[2]);
  162.     SCMF(playerid, COLOR_GREY, "Castig:%d$", rand);
  163.     if(GetVehHp < 990.0)
  164.     {
  165.     vehnev = 1;
  166.     PlayerInfo[playerid][pMoney] += 100;
  167.     SCM(playerid, COLOR_GREY, "Bonus vehicul nelovit:100$");
  168.     GivePlayerCash(playerid, 100);
  169.     }
  170.     if(GetVehHp > 990.0)
  171.     {
  172.     vehnev = 0;
  173.     SCM(playerid, COLOR_GREY, "Bonus vehicule nelovit:0$");
  174.     }
  175.     if(vehnev == 1){
  176.     SCMF(playerid, COLOR_GREY, "Total:%d", rand+100);}
  177.     if(vehnev == 0){
  178.     SCMF(playerid, COLOR_GREY, "Total:%d", rand);}
  179.     defer HideMoney(playerid);
  180.     if(PlayerInfo[playerid][pTure] == 30)
  181.     {
  182.     PlayerInfo[playerid][pSkill] = 2;
  183.     SendClientMessage(playerid, COLOR_YELLOW, "Felicitari, ai atins skill-ul 2 la jobul muncitor de cariera!");
  184.     }
  185.     if(PlayerInfo[playerid][pTure] == 60)
  186.     {
  187.     PlayerInfo[playerid][pSkill] = 2;
  188.     SendClientMessage(playerid, COLOR_YELLOW, "Felicitari, ai atins skill-ul 3 la jobul muncitor de cariera!");
  189.     }}
  190.     return 1;
  191. }
  192. timer HideMoney[5000](playerid)
  193. {
  194.     TextDrawHideForPlayer(playerid, Quarry[3]);
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerExitVehicle(playerid, vehicleid)
  199. {
  200. if(carcheck == CarSkillQuarry[1])
  201.     {
  202.     SendClientMessage(playerid, COLOR_YELLOW, "Ai la dispozitie 20 de secunde sa te intorci la vehiculul de job sau vei pierde misiunea!");
  203.     defer timerquarry(playerid);
  204.     checkcar[playerid] = 0;
  205.     }
  206.     if(carcheck == CarSkillQuarry[2])
  207.     {
  208.     SendClientMessage(playerid, COLOR_YELLOW, "Ai la dispozitie 20 de secunde sa te intorci la vehiculul de job sau vei pierde misiunea!");
  209.     defer timerquarry(playerid);
  210.     checkcar[playerid] = 0;
  211.     }
  212.     if(carcheck == CarSkillQuarry[3])
  213.     {
  214.     SendClientMessage(playerid, COLOR_YELLOW, "Ai la dispozitie 20 de secunde sa te intorci la vehiculul de job sau vei pierde misiunea!");
  215.     defer timerquarry(playerid);
  216.     checkcar[playerid] = 0;
  217. }
  218. return 1;
  219. }
  220.  
  221. timer timerquarry[20000](playerid)
  222. {
  223.     if(checkcar[playerid] == 0)
  224.     {
  225.     DestroyVehicle(CarSkillQuarry[1]);
  226.     DestroyVehicle(CarSkillQuarry[2]);
  227.     DestroyVehicle(CarSkillQuarry[3]);
  228.     DisablePlayerCheckpoint(playerid);
  229.     RemovePlayerFromVehicle(playerid);
  230.     CP[playerid] = 0;
  231.     QuarryCP[playerid] = 0;
  232.     TextDrawHideForPlayer(playerid, Quarry[0]);
  233.     TextDrawHideForPlayer(playerid, Quarry[1]);
  234.     TextDrawHideForPlayer(playerid, Quarry[2]);
  235.     TextDrawHideForPlayer(playerid, Quarry[3]);
  236.     PlayerTextDrawHide(playerid, PlayerQuarry[1]);
  237.     PlayerTextDrawHide(playerid, PlayerQuarry[0]);
  238.     } else return 0;
  239.     return 1;
  240. }
  241.  
  242. CMD:getjob(playerid, params[])
  243. {
  244. if(IsPlayerInRangeOfPoint(playerid, 3.0, 816.6284,856.8055,12.7891))
  245.     {
  246.     if(PlayerInfo[playerid][pJob] <= 10)
  247.     {
  248.     PlayerInfo[playerid][pJob] = 11;
  249.     SendClientMessage(playerid, COLOR_LIGHTBLUE, "Te-ai angajat la Muncitor de Cariera, foloseste /help daca ai nelamuriri!");
  250.     SendClientMessage(playerid, COLOR_LIGHTBLUE, "Foloseste comanda /work pentru a incepe munca.");
  251.     }
  252.     }
  253. return 1;
  254. }
  255.  
  256. CMD:work(playerid, params[])
  257. {
  258. if(PlayerInfo[playerid][pJob] == 11)
  259.     {
  260.     if(!IsPlayerInRangeOfPoint(playerid, 3.5, 849.9559,854.2949,13.3515))
  261.     {
  262.     CP[playerid] = 1;
  263.     SetPlayerCheckpoint(playerid, 849.9559,854.2949,13.3515, 5);
  264.     SendClientMessage(playerid, COLOR_YELLOW, "Urmareste punctul rosu pentru a incepe munca.");
  265.     return 1;
  266.     }
  267.     if(PlayerInfo[playerid][pSkill] == 1)
  268.     {
  269.     if(PlayerInfo[playerid][pWorking] == 0)
  270.     {
  271.     Iter_Add(Quarryplayers, playerid);
  272.     CarSkillQuarry[1] = AddStaticVehicle(486,849.9193,854.2819,13.5156,0.1623,1,1);
  273.     PutPlayerInVehicle(playerid, CarSkillQuarry[1], 0);
  274.     QuarryCP[playerid] = 1;
  275.     SetPlayerCheckpoint(playerid, 839.2156,885.3904,13.3516, 5);
  276.     repeat CheckQuarry(playerid);
  277.     PlayerTextDrawShow(playerid, PlayerQuarry[1]);
  278.     PlayerTextDrawShow(playerid, PlayerQuarry[0]);
  279.     TextDrawShowForPlayer(playerid, Quarry[1]);
  280.     TextDrawShowForPlayer(playerid, Quarry[0]);
  281.     SendClientMessage(playerid, COLOR_YELLOW, "Urmareste punctul de pe harta pentru a incepe munca.");
  282.     PlayerInfo[playerid][pWorking] = 10;
  283.     checkcar[playerid] = 1;
  284.     }}
  285.     if(PlayerInfo[playerid][pSkill] == 2)
  286.     {
  287.     if(PlayerInfo[playerid][pWorking] == 0)
  288.     {
  289.     Iter_Add(Quarryplayers, playerid);
  290.     CarSkillQuarry[2] = AddStaticVehicle(486,849.9193,854.2819,13.5156,0.1623,1,1);
  291.     PutPlayerInVehicle(playerid, CarSkillQuarry[2], 0);
  292.     SetPlayerCheckpoint(playerid, 839.2156,885.3904,13.3516, 5);
  293.     QuarryCP[playerid] = 1;
  294.     repeat CheckQuarry(playerid);
  295.     PlayerTextDrawShow(playerid, PlayerQuarry[1]);
  296.     PlayerTextDrawShow(playerid, PlayerQuarry[0]);
  297.     TextDrawShowForPlayer(playerid, Quarry[1]);
  298.     TextDrawShowForPlayer(playerid, Quarry[0]);
  299.     SendClientMessage(playerid, COLOR_YELLOW, "Urmareste punctul de pe harta pentru a incepe munca.");
  300.     PlayerInfo[playerid][pWorking] = 10;
  301.     checkcar[playerid] = 1;
  302.     }}
  303.     if(PlayerInfo[playerid][pSkill] == 3)
  304.     {
  305.     if(PlayerInfo[playerid][pWorking] == 0)
  306.     {
  307.     Iter_Add(Quarryplayers, playerid);
  308.     CarSkillQuarry[3] = AddStaticVehicle(524,849.9193,854.2819,13.5156,0.1623,1,1);
  309.     PutPlayerInVehicle(playerid, CarSkillQuarry[3], 0);
  310.     SetPlayerCheckpoint(playerid, 839.2156,885.3904,13.3516, 5);
  311.     QuarryCP[playerid] = 1;
  312.     repeat CheckQuarry(playerid);
  313.     PlayerTextDrawShow(playerid, PlayerQuarry[1]);
  314.     PlayerTextDrawShow(playerid, PlayerQuarry[0]);
  315.     TextDrawShowForPlayer(playerid, Quarry[1]);
  316.     TextDrawShowForPlayer(playerid, Quarry[0]);
  317.     SendClientMessage(playerid, COLOR_YELLOW, "Urmareste punctul de pe harta pentru a incepe munca.");
  318.     PlayerInfo[playerid][pWorking] = 10;
  319.     checkcar[playerid] = 1;
  320.     }}
  321.     }
  322. return 1;
  323. }
  324.  
  325. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  326. {
  327. new carcheck = GetPlayerVehicleID(playerid);
  328.     if(carcheck == CarSkillQuarry[1])
  329.     {
  330.     checkcar[playerid] = 1;
  331.     }
  332.     if(carcheck == CarSkillQuarry[2])
  333.     {
  334.     checkcar[playerid] = 1;
  335.     }
  336.     if(carcheck == CarSkillQuarry[3])
  337.     {
  338.     checkcar[playerid] = 1;
  339.     }
  340. return 1;
  341. }
  342.  
  343. stock LoadPlayerText(playerid)
  344. {
  345. PlayerQuarry[0] = CreatePlayerTextDraw(playerid, 597.999694, 327.386383, "You extracted 0 loods earned 0$");
  346.     PlayerTextDrawLetterSize(playerid, PlayerQuarry[0], 0.277599, 0.778665);
  347.     PlayerTextDrawTextSize(playerid, PlayerQuarry[0], -7.000000, 0.000000);
  348.     PlayerTextDrawAlignment(playerid, PlayerQuarry[0], 3);
  349.     PlayerTextDrawColor(playerid, PlayerQuarry[0], -1);
  350.     PlayerTextDrawSetShadow(playerid, PlayerQuarry[0], 0);
  351.     PlayerTextDrawBackgroundColor(playerid, PlayerQuarry[0], 255);
  352.     PlayerTextDrawFont(playerid, PlayerQuarry[0], 1);
  353.     PlayerTextDrawSetProportional(playerid, PlayerQuarry[0], 1);
  354.  
  355.     PlayerQuarry[1] = CreatePlayerTextDraw(playerid, 602.799804, 336.346282, "Workers on duty: 1 / Your skill: 1 (0/30)");
  356.     PlayerTextDrawLetterSize(playerid, PlayerQuarry[1], 0.240799, 0.883198);
  357.     PlayerTextDrawTextSize(playerid, PlayerQuarry[1], -2.000000, 0.000000);
  358.     PlayerTextDrawAlignment(playerid, PlayerQuarry[1], 3);
  359.     PlayerTextDrawColor(playerid, PlayerQuarry[1], -1);
  360.     PlayerTextDrawSetShadow(playerid, PlayerQuarry[1], 0);
  361.     PlayerTextDrawBackgroundColor(playerid, PlayerQuarry[1], 255);
  362.     PlayerTextDrawFont(playerid, PlayerQuarry[1], 1);
  363.     PlayerTextDrawSetProportional(playerid, PlayerQuarry[1], 1);
  364. return 1;
  365. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement