Frage für /skill Befehl

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
  • Hallo ich habe ein Script aus dem inet genommen und habe ein Problem. Bei /skill stand kein Detectiv bei daher habe ich es selber einfach dazu geschrieben.



    {
    new x_nr[24];
    x_nr = strtok(cmdtext, idx);
    if(!strlen(x_nr)) {
    SendClientMessage(playerid, COLOR_WHITE, "|__________________ Skill Info __________________|");
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /skill [number]");
    SendClientMessage(playerid, COLOR_GREY, "| 1: Lawyer 6: Boxer");
    SendClientMessage(playerid, COLOR_GREY, "| 2: Whore 7: Fishing");
    SendClientMessage(playerid, COLOR_GREY, "| 3: Drugs Dealer 8: Detectiv");
    SendClientMessage(playerid, COLOR_GREY, "| 4: News Reporter");
    SendClientMessage(playerid, COLOR_GREY, "| 5: Car mechanic");
    SendClientMessage(playerid, COLOR_WHITE, "|________________________________________________|");
    return 1;
    }


    Dann habe ich noch das hinzu geschrieben unter den Fishing Job:



    else if(strcmp(x_nr,"1",true) == 0)//Detectiv
    {
    new level = PlayerInfo[playerid][pDetSkill];
    if(level >= 0 && level <= 50) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 1."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 51 && level <= 100) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 2."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 101 && level <= 150) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 3."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 151 && level <= 200) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 4."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 201) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 5."); }
    }


    Aber wenn ich /skill 8 mache kommt "Invalid Skill Number".


    Hoffe ihr könnt mir helfen.


    p.s. Bin nicht der Super Scripter also net so schwer machen pls^^

  • else if(strcmp(x_nr,"1",true) == 0)// Hier ist die Zahl Falsch..du musst es in 8 ändern...also .... else if(strcmp(x_nr,"8",true) {
    new level = PlayerInfo[playerid][pDetSkill];
    if(level >= 0 && level <= 50) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 1."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 51 && level <= 100) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 2."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 101 && level <= 150) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 3."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 151 && level <= 200) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 4."); format(string, sizeof(string), "You need to find %d more people to Level up.", 50 - level); SendClientMessage(playerid, COLOR_YELLOW, string); }
    else if(level >= 201) { SendClientMessage(playerid, COLOR_YELLOW, "Your Detectiv Skill Level = 5."); }
    }


    Edit: Würde dir aber raten zu dcmd oder zcmd und sscanf zu wechseln... ;)