sscanf 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
  • Mein Befehl will nicht richtig funktionieren:


    command(help, playerid, params[])
    {
    new text[32];
    if(sscanf(params,"s[32]",text))
    if (strfind("ACCOUNT", text, true) != 0)
    {
    SendClientMessage(playerid, -1, "Account Help:");
    SendClientMessage(playerid, -1, "/changepass, /playerwarns, /stats, /changespawn, /myadminrecord");
    }
    else if(strcmp(text,"GENERAL",true) == 0)
    {
    SendClientMessage(playerid, -1, "General Help:");
    SendClientMessage(playerid, GREY, "/me, /enter, /joinevent, /changemyname, /assistance, /exit, /forums, /showlicenses, /do, /attempt, /kill, /joinevent, /o(oc), /gps, /accent, /blindfold, /togwt");
    SendClientMessage(playerid, GREY, "/buyhouse, /buybusiness, /b, /accept, /pay, /low, /dropcar, /fish, /give, /w(hisper), /eject, /rules, /unblindfold");
    SendClientMessage(playerid, GREY, "/toggleradio, /tie, /untie, /drop, /usefightstyle, /togooc, /flipcoin, /buyid, /showid, /knock, /answerq, /pm, /togpms");
    SendClientMessage(playerid, GREY, "/togspeedo, /drag, /stopdrag, /giveweapon, /achievements, /getid, /calculate, /togradio");
    SendClientMessage(playerid, GREY, "/mask");
    }
    else if(strcmp(text,"DONATOR",true) == 0)
    {
    if(Player[playerid][VipRank] >= 1)
    {
    SendClientMessage(playerid, -1, "Donator Commands.");
    SendClientMessage(playerid, GREY, "Level 1: /dooc, /togdooc, /toggold");
    }
    if(Player[playerid][VipRank] >= 2)
    {
    SendClientMessage(playerid, GREY, "Level 2: /ocarcolor (free)");
    }
    else
    {
    SendClientMessage(playerid, -1, "You are not a donator.");
    }
    }
    else if(strcmp(text,"PHONE",true) == 0)
    {
    SendClientMessage(playerid, -1, "Phone Help:");
    SendClientMessage(playerid, GREY, "/call, /getnumber, /phone, /hangup, /p(hone)on, /p(hone)off.");
    }
    else if(strcmp(text,"FACTION",true) == 0)
    {
    return cmd_factionhelp(playerid, params);
    }
    else if(strcmp(text,"HOUSE",true) == 0)
    {
    SendClientMessage(playerid, GREY, "/buyvault, /hbalance, /home, /hwithdraw, /hlistweapons, /hgetweapon, /hstoreweapon, /hdeposit, /lockhouse, /abandonhouse");
    }
    else if(strcmp(text,"JOB",true) == 0)
    {
    if(Player[playerid][Job] >= 1)
    {
    switch(Jobs[Player[playerid][Job]][JobType])
    {
    case 1:
    {
    SendClientMessage(playerid, GREY, "Weapons Dealer Job: /makegun, /quitjob");
    }
    case 2:
    {
    SendClientMessage(playerid, GREY, "Mechanic Job: /nos, /fix.");
    }
    case 3:
    {
    return 1;
    }
    case 4:
    {
    return 1;
    }
    case 5:
    {
    return 1;
    }
    case 6:
    {
    SendClientMessage(playerid, WHITE, "Drug Dealer Job: /buydrug, /quitjob");
    }
    case 7:
    {
    return 1;
    }
    }
    }
    }
    else if(strcmp(text,"VEHICLE",true) == -1)
    {
    SendClientMessage(playerid, GREY, "/fill, /buycar, /viewstock, /abandoncar, /mycars, /lock, /givecar, /parkcar, /vget, /vstore, /vinfo");
    }
    else if(strcmp(text,"BANK",true) == -1)
    {
    SendClientMessage(playerid, GREY, "/bank, /wiretransfer, /givecheck, /redeemcheck");
    }
    else if(strcmp(text,"ANIMATIONS",true) == -1)
    {
    SendClientMessage(playerid, GREY, "/dance, /reload, /crossarms, /piss, /handsup, /crack, /sit, /gsit, /fallback, /rap, /pedmove, /robman, /stopanim");
    SendClientMessage(playerid, GREY, "/bomb, /vomit, /wave, /deal, /chat, /spank, /middlefinger, /laugh, /bar, /hide, /masturbate, /shakehand");
    }
    else if(strcmp(text,"BUSINESS",true) == -1)
    {
    SendClientMessage(playerid, GREY, "/supplystatus, /enterfee, /collectearnings");
    switch(Businesses[Player[playerid][InBusiness]][bType])
    {
    case 1: SendClientMessage(playerid, WHITE, "/buy");
    case 2: SendClientMessage(playerid, WHITE, "/buyclothes");
    case 3: SendClientMessage(playerid, WHITE, "/buydrink");
    case 4: SendClientMessage(playerid, WHITE, "/advert, /padvert.");
    case 5: SendClientMessage(playerid, WHITE, "/buy");
    case 6: SendClientMessage(playerid, WHITE, "/buyvehicle");
    case 7: SendClientMessage(playerid, WHITE, "/takecourse");
    case 8: SendClientMessage(playerid, WHITE, "/donate");
    case 9: SendClientMessage(playerid, WHITE, "/propose");
    case 10: SendClientMessage(playerid, WHITE, "/buyfightstyle");
    case 11: SendClientMessage(playerid, WHITE, "/buy");
    case 12: SendClientMessage(playerid, WHITE, "/buy");
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid, -1, "{33FF33}Usage: /help [section]");
    SendClientMessage(playerid, -1, "Account, General, Donator, Phone, Faction, Job, Vehicle, House, Bank, Animations, Business");
    }
    return true;
    }


    Es wird immer nur wenn ich /help eingebe direkt GENERAL ausgeführt. Will allerdings, das man einzellne Gruppen auswählen kann. Wie geht das?