Jump to content

[REZOLVAT] Problema Job


NitroGEN
 Share

Recommended Posts

Username: NitroGEN

Problema întălnită: Job

Detalii despre problemă: Am facut un job de la 0 pe gamemode burned, am facut totu bine si cand dau startwork nu se intampla nimic adica normal trebuia sa imi dea masina sa incep munca si nu o da. Tin sa precizez ca in baza de date este masina pusa si degeaba.

Ce ai încercat să faci înainte să postezi?:  Sa il fac.

Cod sursă (recomandat pastebin.com) : Nu stiu sigur ce trebuie sa pun, ce o sa mi se ceara o sa pun.

Alte detalii: Mersi

Link to comment
Share on other sites

YCMD:startwork(playerid, params[], help) {
    if(PlayerInfo[playerid][pJob] == 11) return SCM(playerid, -1, "Foloseste /fish pentru a incepe munca la acest job!");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti aceasta comanda dintr-un vehicul!");
    new Float: Pos[3], Float: CarAngle, string[128];
    if(PlayerInfo[playerid][pJob] == 0) return SCM(playerid, COLOR_GREY, "Nu ai un job!");
    if(JobWorking[playerid] == 1) return SCM(playerid, COLOR_WHITE, "Muncesti deja.");
            
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(targetfind[playerid] != -1) 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");
    if(GetPlayerVirtualWorld(playerid) != 0) return 1;
    if(JobDeelay[playerid][PlayerInfo[playerid][pJob]] != 0 && PlayerInfo[playerid][pAdmin] < 6) return JobTimeDeelay(playerid);
    switch(PlayerInfo[playerid][pJob]) {
        case 1: {
            if(PlayerToPoint(7.0, playerid, -372.6979, -1456.3641, 26.4046)) {
                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!");
                JobSeconds[playerid] = 120;
                CarAngle = -184.0199;
                DisablePlayerCheckpointEx(playerid);
            }
            else {
                 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");
                  CP[playerid] = 53;
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, -372.6979, -1456.3641, 26.4046, 7.0);
                return 1;
            }
        }
        case 2: {
            if(PlayerToPoint(7.0, playerid, -1017.3097,-638.8459,32.0078)) {
                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!");
                CarAngle = 74.1729;
                CP[playerid] = 52;
                DisablePlayerCheckpointEx(playerid);
                new szDialog2[1024];                
                strcat(szDialog2, "Category\tType\tSkill\n");
                strcat(szDialog2, "Clothes\t{35DE1F}Legal\t1+\n");
                strcat(szDialog2, "Food\t{35DE1F}Legal\t1+\n");
                strcat(szDialog2, "Furniture\t{35DE1F}Legal\t1+\n");
                strcat(szDialog2, "Explosible\t{35DE1F}Legal\t2+\n");
                strcat(szDialog2, "Guns\t{F21313}Illegal\t3+\n");
                strcat(szDialog2, "Stolen cars\t{F21313}Illegal\t3+\n");
                ShowPlayerDialog(playerid, DIALOG_TRUCKER, DIALOG_STYLE_TABLIST_HEADERS, "Choose destination", szDialog2, "Select", "Cancel");            
            }
            else {
                 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");
                  CP[playerid] = 53;
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, -1017.3097,-638.8459,32.0078, 7.0);
                return 1;
            }
        }
        case 3: {
            if(PlayerToPoint(7.0, playerid, -1966.2852,-2442.2708,30.6250)) {
                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!");
                format(string, sizeof(string), "Du-te la un copac din apropiere si foloseste tasta ~b~~h~LALT~w~~h~ pentru a-l taia.");
                PlayerTextDrawSetString(playerid, InfosTD, string);
                SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
                PlayerTextDrawShow(playerid, InfosTD);    
                CarAngle = 222.7997;            }
            else {
                 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");
                  CP[playerid] = 53;
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, -1966.2852,-2442.2708,30.6250, 7.0);
                return 1;
            }        
        }
        case 4: {
            if(GetPlayerSkill(playerid) == 1) PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul public!");
            else if(GetPlayerSkill(playerid) == 2) PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul personal descuiat!");
            else if(GetPlayerSkill(playerid) == 3) PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul ce apartine unei mafii!");
            else if(GetPlayerSkill(playerid) == 4) PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul personal incuiat!");
            else if(GetPlayerSkill(playerid) == 5) PlayerTextDrawSetString(playerid, InfosTD, "~y~Car Jacker~w~~h~~n~Fura un vehicul ce apartine unui departament de politie!");
            PlayerTextDrawShow(playerid, InfosTD);
            JobWorking[playerid] = 1;
            SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
            return 1;
        }
        case 5: {
            if(PlayerInfo[playerid][pWantedLevel] != 0) return SCM(playerid, -1, "Nu poti munci la acest job deoarece ai wanted!");
            if(!PlayerToPoint(10.0, playerid, 2770.2822,-1610.9043,11.0418)) {                
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, 2770.2822,-1610.9043,11.0418, 10.0);
                CP[playerid] = 53;
                return 1;
            }
            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!");
            CP[playerid] = 156;
            new rand = random(3);            
            switch(rand) {
                case 0: SetPlayerCheckpointEx(playerid, 2790.6213,-2523.6418,13.6704, 5.0);
                case 1: SetPlayerCheckpointEx(playerid, 2529.4214,-2009.4240,13.5798, 5.0);
                case 2: SetPlayerCheckpointEx(playerid, 2180.0774,-2317.1672,13.5703, 5.0);
                case 3: SetPlayerCheckpointEx(playerid, 681.2267,-442.6591,16.3633, 5.0);
            }
            
            format(string, sizeof(string), "Du-te la checkpoint-ul de pe mapa pentru a livra materialele!");
            PlayerTextDrawSetString(playerid, InfosTD, string);
            SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
            PlayerTextDrawShow(playerid, InfosTD);
            
            CarAngle = 277.2561;
            StartingWork[playerid] = 0;
            CurseFacute[playerid] = 0;
            MoneyEarned[playerid] = 0;        
        }
        case 6..8: return 1;
        case 9: {
            if(PlayerToPoint(7.0, playerid, 2113.9392,-1775.1980,13.3918)) {
                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!");
                CarAngle = 0;
                CP[playerid] = 155;
                new j = random(housess)+1;
                if(j == 0) j = 1;
                SetPlayerCheckpointEx(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez], 7.0);
                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]));
                PlayerTextDrawSetString(playerid, InfosTD, string);
                SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
                PlayerTextDrawShow(playerid, InfosTD);                
            }
            else {
                 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");
                  CP[playerid] = 53;
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid,2113.9392,-1775.1980,13.3918, 7.0);
                return 1;
            }
        }    
        case 10: {
            if(!PlayerToPoint(6.0, playerid, 844.6592,-601.3264,18.4219)) {
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, 844.6592,-601.3264,18.4219, 6.0);
                CP[playerid] = 53;
                return 1;
            }
            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!");
            CarAngle = 0.7028;
            CP[playerid] = 57;
            
            new rand = random(3);
            if(rand == 1) SetPlayerCheckpointEx(playerid, 830.0479, -611.8955, 16.3432, 5.0);
            else if(rand == 2) SetPlayerCheckpointEx(playerid, 820.7677, -612.4786, 16.3432, 5.0);
            else if(rand == 3) SetPlayerCheckpointEx(playerid, 790.9538, -612.2801, 16.3432, 5.0);
            else SetPlayerCheckpointEx(playerid, 830.0479, -611.8955, 16.3432, 5.0);
            
            PlayerTextDrawSetString(playerid, InfosTD, "Du-te la punctul ~r~rosu~w~~h~ pentru a incarca coletele!");
            SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
            PlayerTextDrawShow(playerid, InfosTD);    
        }        
        case 12: {
            if(!PlayerToPoint(20.0, playerid, 1947.3197,-2387.1599,13.5469)) {
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, 1947.3197,-2387.1599,13.5469, 20.0);
                CP[playerid] = 53;
                return 1;
            }
            if(PlayerInfo[playerid][pFlyLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Ai nevoie de o licenta de zbor pentru a putea munci la acest job!");
            if(PlayerInfo[playerid][pWantedLevel] != 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti munci la acest job deoarece ai wanted!");            
            CP[playerid] = 159;
            SetPlayerRaceCheckpointEx(playerid, 3, 1897.3568,-2493.9583,14.4609,1337.7225,-2458.1738,52.1955, 5.0);
            CarAngle = 90.6909;
            StartingWork[playerid] = 0;
            CurseFacute[playerid] = 0;
            MoneyEarned[playerid] = 0;        
        }
        case 13: {
            if(!PlayerToPoint(7.0, playerid, 2173.3965,-2265.2837,13.3579)) {
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, 2173.3965,-2265.2837,13.3579, 7.0);
                CP[playerid] = 53;
                return 1;
            }    
            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!");
            PlayerTextDrawSetString(playerid, InfosTD, "Du-te la ~r~~h~checkpoint-ul~w~~h~ de pe mapa pentru a lua marfa!");
            SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
            PlayerTextDrawShow(playerid, InfosTD);            
            new rand = random(2);
            DisablePlayerCheckpointEx(playerid);
            switch(rand) {
                case 0: {
                    playerObject[playerid] = CreatePlayerObject(playerid, 1271, 2214.87109, -2287.46167, 14.06371,   0.00000, 0.00000, 45.00000);
                    SetPlayerCheckpointEx(playerid, 2214.87109, -2287.46167, 14.06371, 2.0);            
                }
                case 1: {
                    playerObject[playerid] = CreatePlayerObject(playerid, 1271, 2237.34399, -2294.11938, 14.08454,   0.00000, 0.00000, 45.00000);
                    SetPlayerCheckpointEx(playerid, 2237.34399, -2294.11938, 14.08454, 2.0);
                }
                case 2: {
                    playerObject[playerid] = CreatePlayerObject(playerid, 1271, 2216.74878, -2210.50146, 12.86219,   0.00000, 0.00000, 45.00000);    
                    SetPlayerCheckpointEx(playerid, 2216.74878, -2210.50146, 12.86219, 2.0);
                }
            }
            CP[playerid] = 170;
            UpdateJobStats(playerid);
        }
        case 14: {
            if(!PlayerToPoint(7.0, playerid, 21630.4603,-2251.8972,13.3254)) {
                SCM(playerid, COLOR_GREY, "Nu esti la locul unde poti incepe munca. Ti-am pus un checkpoint, du-te la el!");
                SetPlayerCheckpointEx(playerid, 1630.4603,-2251.8972,13.3254, 7.0);
                CP[playerid] = 53;
                return 1;
            }
                CarAngle = 411;
                CP[playerid] = 155;
                new j = random(housess)+1;
                if(j == 0) j = 1;
                SetPlayerCheckpointEx(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez], 7.0);
                format(string, sizeof(string), "Du-te la punctul ~r~~h~rosu~w~~h~ de pe mapa pentru a livra coletele.~n~Distanta: ~y~%0.1fm.", GetPlayerDistanceFromPoint(playerid, HouseInfo[j][hEntrancex],HouseInfo[j][hEntrancey],HouseInfo[j][hEntrancez]));
                PlayerTextDrawSetString(playerid, InfosTD, string);
                SetTimerEx("HideTextdraw", 8000, 0, "%d", playerid);
                PlayerTextDrawShow(playerid, InfosTD);
        }
    }
    SetPVarInt(playerid, "Pressed", 0);
    SetPVarInt(playerid, "Trees", 0);
    SetPVarInt(playerid, "JobStep", 0);                
    SetPVarInt(playerid, "InHand", 0);                
    
    MoneyEarned[playerid] = 0;
    CurseFacute[playerid] = 0;
    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).");
    new skill = GetPlayerSkill(playerid);
    if(PlayerInfo[playerid][pJob] == 11) {
        new rand = 1 + random(5);        
        if(rand == 1) { Pos[0] = 877.5832; Pos[1] = -2126.4685; Pos[2] = 0.3231; CarAngle = -89.2800; }
        if(rand == 2) { Pos[0] = 877.3463; Pos[1] = -2113.4219; Pos[2] = 0.3231; CarAngle = -89.2800; }
        if(rand == 3) { Pos[0] = 796.3821; Pos[1] = -2114.0200; Pos[2] = -0.0049; CarAngle = 89.7000; }
        if(rand == 4) { Pos[0] = 796.9351; Pos[1] = -2127.4446; Pos[2] = -0.0049; CarAngle = 89.7000; }
        if(rand == 5) { Pos[0] = 796.1244; Pos[1] = -2100.6455; Pos[2] = -0.0049; CarAngle = 89.7000; }
        if(rand == 6) { Pos[0] = 797.0450; Pos[1] = -2139.8650; Pos[2] = -0.0049; CarAngle = 89.7000; }
    }
    if(PlayerInfo[playerid][pJob] == 12) {
        if(skill == 1) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill1Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 2) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill2Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 3) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill3Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 4) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill4Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 5) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill5Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);    
    }
    else {
        if(PlayerInfo[playerid][pJob] == 3) {
            if(skill == 1) JobVehicle[playerid] = CreateVehicleEx(578, Pos[0], Pos[1], Pos[2], CarAngle, random(240), random(240), -1);
            else if(skill == 2) JobVehicle[playerid] = CreateVehicleEx(578, Pos[0], Pos[1], Pos[2], CarAngle, random(240), random(240), -1);
            else if(skill == 3) JobVehicle[playerid] = CreateVehicleEx(578, Pos[0], Pos[1], Pos[2], CarAngle, random(240), random(240), -1);
            else if(skill == 4) JobVehicle[playerid] = CreateVehicleEx(578, Pos[0], Pos[1], Pos[2], CarAngle, random(240), random(240), -1);
            else if(skill == 5) JobVehicle[playerid] = CreateVehicleEx(578, Pos[0], Pos[1], Pos[2], CarAngle, random(240), random(240), -1);        
        }
        else {
            if(skill == 1) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill1Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1);
            else if(skill == 2) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill2Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1);
            else if(skill == 3) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill3Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1);
            else if(skill == 4) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill4Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1);
            else if(skill == 5) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill5Veh], Pos[0], Pos[1], Pos[2], CarAngle, -1, -1, -1);
        }
        else {
            if(PlayerInfo[playerid][pJob] == 14) {
        if(skill == 1) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill1Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 2) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill2Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 3) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill3Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 4) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill4Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
        else if(skill == 5) JobVehicle[playerid] = CreateVehicleEx(JobInfo[PlayerInfo[playerid][pJob]][jSkill5Veh], 1982.5657,-2493.7964,14.4719, CarAngle, -1, -1, -1);
    }   

 

 

Job-ul meu este case 14

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...