Jobsystem - Frage

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hey Leute,
    würde gerne auf nem ausgewählten Punkt auf der Karte einen Befehl machen /job - Dann kommen halt die Jobs aufgelistet und dann wenn man /job carjacker macht das dann da steht /accept job und wenn man das tut das man ihn hat.


    Könnte mir bitte jemand die richtung weisen?


    Danke

  • Hey hab mal was gemacht bekomme errors wegen PlayerToPoint....


    Ist das überhaupt so umsetzbar oder muss ich dann jedenjob einzeln machen also bei /joinjob halt die auflistung.
    Dann einzelnen begriff /joinjob Car jacker.... oder geht das auf diesem wege?



    if(strcmp(cmd, "/joinjob", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pJob] == 0 || PlayerToPoint(4.0, playerid,363.2375,176.2490,1008.3828)
    {
    if(PlayerInfo[playerid][pLeader] != 12)
    {
    if(gTeam[playerid] == 1 || gTeam[playerid] == 2 || gTeam[playerid] == 4 || gTeam[playerid] == 11)
    {
    SendClientMessage(playerid, COLOR_GREY, " You must be a Civilian (Not Wanted) or a Family Member to get a Job !");
    return 1;
    }
    }
    new x_nr[256];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr))
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "|____________________ Jobcenter ____________________|");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Locomotiv Driver Car Dealer");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Lawyer Boxer");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Whore Bus Driver");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Drugs Dealer Paperboy");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Car Jacker Trucker");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Car Mechanic Detectiv");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Bodyguard Stuntman");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "| Arms Dealer Pilot");
    SendClientMessage(playerid, COLOR_LIGHTRED, "Help: /joinjob [job]"); SendClientMessage(playerid, COLOR_LIGHTRED, "|____________________ Jobcenter ____________________|");
    return 1;
    }
    if(strcmp(x_nr,"Locomotiv Driver",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Locomotiv Driver and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Locomotiv Driver, type /accept job.");
    GettingJob[playerid] = 1;
    return 1;
    }
    else if(strcmp(x_nr,"Lawyer",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Whore and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Whore, type /accept job.");
    GettingJob[playerid] = 2;
    return 1;
    }
    else if(strcmp(x_nr,"Whore",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Whore and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Whore, type /accept job.");
    GettingJob[playerid] = 3;
    return 1;
    }
    else if(strcmp(x_nr,"Drugs Dealer",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Drugs Dealer and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Drugs Dealer, type /accept job.");
    GettingJob[playerid] = 4;
    return 1;
    }
    else if(strcmp(x_nr,"Car Jacker",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Jacker and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Jacker, type /accept job.");
    GettingJob[playerid] = 5;
    return 1;
    }
    else if(strcmp(x_nr,"Car Mechanic",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Mechanic and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Mechanic, type /accept job.");
    GettingJob[playerid] = 7;
    return 1;
    }
    else if(strcmp(x_nr,"Bodyguard",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Bodyguard and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Bodyguard, type /accept job.");
    GettingJob[playerid] = 8;
    return 1;
    }
    else if(strcmp(x_nr,"Arms Dealer",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Arms Dealer and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Arms Dealer, type /accept job.");
    GettingJob[playerid] = 9;
    return 1;
    }
    else if(strcmp(x_nr,"Car Dealer",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Car Dealer and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Car Dealer, type /accept job.");
    GettingJob[playerid] = 10;
    return 1;
    }
    else if(strcmp(x_nr,"Boxer",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Boxer and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Boxer, type /accept job.");
    GettingJob[playerid] = 12;
    return 1;
    }
    else if(strcmp(x_nr,"Bus Driver",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Bus Driver and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Bus Driver, type /accept job.");
    GettingJob[playerid] = 14;
    return 1;
    else if(strcmp(x_nr,"Paperboy",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Paperboy and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Paperboy, type /accept job.");
    GettingJob[playerid] = 15;
    return 1;
    }
    else if (strcmp(x_nr,"Trucker",true) == 0 && GetPlayerState(playerid) == 1 && PlayerToPoint(3.0, playerid,363.2375,176.2490,1008.3828))
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are about to become a Trucker and get a 5 hour Contract.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have to forfill this Contract first, if you want to Quit the job later.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* If you are sure to become a Trucker, type /accept job.");
    GettingJob[playerid] = 16;
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not even near a place to get a Job !");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " You already have a Job, use /quitjob first !");
    }
    }
    return 1;
    }

    2 Mal editiert, zuletzt von MrReece ()