Unknow Command bei /stats

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 Com.,
    ich war grade bissl am Scripttesten. Es klappt auch alles soweit nur der /stats befehl geht nicht.
    Es steht immer wenn ich /stats eingebe Unknow Command.
    Es gibt keine Errors/Warnings. Ich hoffe mir kann jemand helfen:
    if(strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new snstring[250],sstring[250],plname[MAX_PLAYER_NAME],fleader = pInfo[playerid][leader],member = pInfo[playerid][team],fname[256],jleader[256],pstring[250],pa = pInfo[playerid][premium];
    new rank = pInfo[playerid][frank],rstring[256],adminlevel = pInfo[playerid][admin],asstring[250],jstring[250], job = pInfo[playerid][pjob],sstring1[250],sstring2[250],sstringverbindung[500],astring[50];


    if(job == 1) { format(jstring,80,"Straßenkehrer"); }
    else if(job == 2) { format(jstring,80,"Hure/Callboy"); }
    else if(job == 3) { format(jstring,80,"Zuhälter"); }
    else if(job == 4) { format(jstring,80,"Eisverkäufer"); }
    else if(job == 5) { format(jstring,80,"Hotdogverkäufer"); }
    else if(job == 6) { format(jstring,80,"Drogenkurrier"); }
    else if(job == 7) { format(jstring,80,"Zeitungsjunge"); }
    else if(job == 8) { format(jstring,80,"Müllmann"); }
    else if(job == 9) { format(jstring,80,"Busfahrer"); }
    else if(job == 10) { format(jstring,80,"Taxifahrer"); }
    else if(job == 11) { format(jstring,80,"Bodyguard"); }
    else if(job == 12) { format(jstring,80,"Freiwillige Feuerwehr"); }
    else if(job == 13) { format(jstring,80,"Freiwillige Polizei"); }
    else if(job == 14) { format(jstring,80,"Bestatter"); }
    else if(job == 15) { format(jstring,80,"Sportler"); }
    else if(job == 16) { format(jstring,80,"ADAC"); }
    else if(job == 17) { format(jstring,80,"Waffenhändler"); }

    if(member == 1 && rank == 1) { format(rstring,80,"Auszubildender Polizist"); }
    else if(member == 1 && rank == 2) { format(rstring,80,"Ausgebilderter Polizist"); }
    else if(member == 1 && rank == 3) { format(rstring,80,"Officer"); }
    else if(member == 1 && rank == 4) { format(rstring,80,"Kommisar"); }
    else if(member == 1 && rank == 5) { format(rstring,80,"Pressesprecher"); }
    else if(member == 1 && rank == 6) { format(rstring,80,"Einsatzleiter"); }


    if(member == 2 && rank == 1) { format(rstring,80,"Samariter"); }
    else if(member == 2 && rank == 2) { format(rstring,80,"Rettungstransportsanitäter"); }
    else if(member == 2 && rank == 3) { format(rstring,80,"Transportsanitäter"); }
    else if(member == 2 && rank == 4) { format(rstring,80,"Rettungssanitäter"); }
    else if(member == 2 && rank == 5) { format(rstring,80,"Notarzt"); }
    else if(member == 2 && rank == 6) { format(rstring,80,"Leitender Notarzt"); }


    if(member == 3 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 3 && rank == 2) { format(rstring,80,"Camora"); }
    else if(member == 3 && rank == 3) { format(rstring,80,"Broter"); }
    else if(member == 3 && rank == 4) { format(rstring,80,"Gangsta"); }
    else if(member == 3 && rank == 5) { format(rstring,80,"Frontman"); }
    else if(member == 3 && rank == 6) { format(rstring,80,"Boss"); }

    if(member == 4 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 4 && rank == 2) { format(rstring,80,"Blackhand"); }
    else if(member == 4 && rank == 3) { format(rstring,80,"Broter"); }
    else if(member == 4 && rank == 4) { format(rstring,80,"Gangsta"); }
    else if(member == 4 && rank == 5) { format(rstring,80,"Frontman"); }
    else if(member == 4 && rank == 6) { format(rstring,80,"Boss"); }

    if(member == 5 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 5 && rank == 2) { format(rstring,80,"Local Reporter"); }
    else if(member == 5 && rank == 3) { format(rstring,80,"Local Editor"); }
    else if(member == 5 && rank == 4) { format(rstring,80,"Netzwerk Anker"); }
    else if(member == 5 && rank == 5) { format(rstring,80,"Netzwerk Editor"); }
    else if(member == 5 && rank == 6) { format(rstring,80,"Netzwerk Produzent"); }

    if(member == 6 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 6 && rank == 2) { format(rstring,80,"Ausbilder"); }
    else if(member == 6 && rank == 3) { format(rstring,80,"Senior Ausbilder"); }
    else if(member == 6 && rank == 4) { format(rstring,80,"Manager"); }
    else if(member == 6 && rank == 5) { format(rstring,80,"Unter Boss"); }
    else if(member == 6 && rank == 6) { format(rstring,80,"Boss"); }


    if(adminlevel == 0) { format(asstring,80,"Kein Admin"); }
    else if(adminlevel == 1) { format(asstring,80,"Adminlevel 1"); }
    else if(adminlevel == 2) { format(asstring,80,"Adminlevel 2"); }
    else if(adminlevel == 3) { format(asstring,80,"Adminlevel 3"); }
    else if(adminlevel == 4) { format(asstring,80,"Adminlevel 4"); }
    else if(adminlevel == 5) { format(asstring,80,"Owner/Co-Owner"); }


    if(member == 0) { format(fname,80,"Zivilist"); }
    else if(member == 1) { format(fname,80,"Polizei"); }
    else if(member == 2) { format(fname,80,"Sanitäter"); }
    else if(member == 3) { format(fname,80,"Las Camoras"); }
    else if(member == 4) { format(fname,80,"The Black Hand"); }
    else if(member == 5) { format(fname,80,"News Reporter"); }
    else if(member == 6) { format(fname,80,"Fahrschule"); }
    if(fleader == 0) { format(jleader,80,"Nein"); }
    else if(fleader == 1) { format(jleader,80,"Ja"); }
    if(pa == 0) { format(pstring,80,"Nein"); }
    else if(pa == 1) { format(pstring,80,"Ja"); }

    if(pInfo[playerid][autoschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][autoschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][bootsschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][bootsschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][truckschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][truckschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][motorradschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][motorradschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][quadschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][quadschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][freischwimmer] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][freischwimmer] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][flugzeugschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][flugzeugschein] == 1) { format(astring,80,"Vorhanden"); }

    GetPlayerName(playerid, plname, sizeof(plname));
    format(sstring,sizeof(sstring),"Adminlevel:[%s]\nGeld:[%d]\nBank:[%d]\nPremium:[%s]\nHandynummer:[%d]\nGuthaben:[%d]\nFraktion:[%s]\nFraktionsrank:[%s]\nFraktionsleader:[%s]\nJob:[%s]\nAlter: Wochen:[%d] Monate:[%d] Jahre:[%d]\nZeit bis du älter wirst:[%d]",asstring,pInfo[playerid][geld],pInfo[playerid][pBank],pstring,pInfo[playerid][pHandyNr],pInfo[playerid][pHCash],fname,rstring,jleader,jstring,pInfo[playerid][wochen],pInfo[playerid][monate],pInfo[playerid][jahre],pInfo[playerid][payday]);
    format(sstring1,sizeof(sstring1),"{FF9600}Autoführerschein: [%s] Strafpunkte: [%d/6] Bootsführerschein: [%s] Strafpunkte: [%d/6]\nLKW Führerschein: [%s] Strafpunkte: [%d/6] Motorradführerschein: [%s] Strafpunkte[%d/6]\nQuadführerschein: [%s] Strafpunkte[%d/6] Freischwimmer: [%s] Strafpunkte[%d/6]\nFlugführerschein: [%s] Strafpunkte[%d/6]",astring,pInfo[playerid][apunkte],astring,pInfo[playerid][bpunkte],astring,pInfo[playerid][tpunkte],astring,pInfo[playerid][mpunkte]);
    format(sstring2,sizeof(sstring1),"Quadführerschein: [%s] Strafpunkte:[%d/6] Freischwimmer: [%s] Strafpunkte: [%d/6]\nFlugführerschein: [%s] Strafpunkte: [%d/6]{FAFAFA}",astring,pInfo[playerid][qpunkte],astring,pInfo[playerid][freipunkte],astring,pInfo[playerid][flugpunkte]);
    format(sstringverbindung, (sizeof string), "%s\n%s\n%s",sstring,sstring1);
    format(snstring,sizeof(snstring),"Dein Stats:%s",plname);
    ShowPlayerDialog(playerid,37,DIALOG_STYLE_MSGBOX,snstring,sstringverbindung,"OK", "Abbrechen");

    return 1;
    }
    mfg


    Bewerte mich und meine Transaktionen als Mittelsmann

  • Check' mal das! Ueberschreib das auf dein strcmp, hab' es etwas veraendert:


    if(strcmp("/stats", cmdtext, true, 6) == 0)


    Warum hattest du nach true 10 geschrieben? /stats ist nur 6 chars^^

  • if(strcmp("/stats", cmdtext, true, 6) == 0)
    {
    new snstring[250],sstring[250],plname[MAX_PLAYER_NAME],fleader = pInfo[playerid][leader],member = pInfo[playerid][team],fname[256],jleader[256],pstring[250],pa = pInfo[playerid][premium];
    new rank = pInfo[playerid][frank],rstring[256],adminlevel = pInfo[playerid][admin],asstring[250],jstring[250], job = pInfo[playerid][pjob],sstring1[250],sstring2[250],sstringverbindung[500],astring[50];


    if(job == 1) { format(jstring,80,"Straßenkehrer"); }
    else if(job == 2) { format(jstring,80,"Hure/Callboy"); }
    else if(job == 3) { format(jstring,80,"Zuhälter"); }
    else if(job == 4) { format(jstring,80,"Eisverkäufer"); }
    else if(job == 5) { format(jstring,80,"Hotdogverkäufer"); }
    else if(job == 6) { format(jstring,80,"Drogenkurrier"); }
    else if(job == 7) { format(jstring,80,"Zeitungsjunge"); }
    else if(job == 8) { format(jstring,80,"Müllmann"); }
    else if(job == 9) { format(jstring,80,"Busfahrer"); }
    else if(job == 10) { format(jstring,80,"Taxifahrer"); }
    else if(job == 11) { format(jstring,80,"Bodyguard"); }
    else if(job == 12) { format(jstring,80,"Freiwillige Feuerwehr"); }
    else if(job == 13) { format(jstring,80,"Freiwillige Polizei"); }
    else if(job == 14) { format(jstring,80,"Bestatter"); }
    else if(job == 15) { format(jstring,80,"Sportler"); }
    else if(job == 16) { format(jstring,80,"ADAC"); }
    else if(job == 17) { format(jstring,80,"Waffenhändler"); }
    printf("2");

    if(member == 1 && rank == 1) { format(rstring,80,"Auszubildender Polizist"); }
    else if(member == 1 && rank == 2) { format(rstring,80,"Ausgebilderter Polizist"); }
    else if(member == 1 && rank == 3) { format(rstring,80,"Officer"); }
    else if(member == 1 && rank == 4) { format(rstring,80,"Kommisar"); }
    else if(member == 1 && rank == 5) { format(rstring,80,"Pressesprecher"); }
    else if(member == 1 && rank == 6) { format(rstring,80,"Einsatzleiter"); }
    printf("3");


    if(member == 2 && rank == 1) { format(rstring,80,"Samariter"); }
    else if(member == 2 && rank == 2) { format(rstring,80,"Rettungstransportsanitäter"); }
    else if(member == 2 && rank == 3) { format(rstring,80,"Transportsanitäter"); }
    else if(member == 2 && rank == 4) { format(rstring,80,"Rettungssanitäter"); }
    else if(member == 2 && rank == 5) { format(rstring,80,"Notarzt"); }
    else if(member == 2 && rank == 6) { format(rstring,80,"Leitender Notarzt"); }
    printf("4");


    if(member == 3 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 3 && rank == 2) { format(rstring,80,"Camora"); }
    else if(member == 3 && rank == 3) { format(rstring,80,"Broter"); }
    else if(member == 3 && rank == 4) { format(rstring,80,"Gangsta"); }
    else if(member == 3 && rank == 5) { format(rstring,80,"Frontman"); }
    else if(member == 3 && rank == 6) { format(rstring,80,"Boss"); }
    printf("5");

    if(member == 4 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 4 && rank == 2) { format(rstring,80,"Blackhand"); }
    else if(member == 4 && rank == 3) { format(rstring,80,"Broter"); }
    else if(member == 4 && rank == 4) { format(rstring,80,"Gangsta"); }
    else if(member == 4 && rank == 5) { format(rstring,80,"Frontman"); }
    else if(member == 4 && rank == 6) { format(rstring,80,"Boss"); }
    printf("6");

    if(member == 5 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 5 && rank == 2) { format(rstring,80,"Local Reporter"); }
    else if(member == 5 && rank == 3) { format(rstring,80,"Local Editor"); }
    else if(member == 5 && rank == 4) { format(rstring,80,"Netzwerk Anker"); }
    else if(member == 5 && rank == 5) { format(rstring,80,"Netzwerk Editor"); }
    else if(member == 5 && rank == 6) { format(rstring,80,"Netzwerk Produzent"); }
    printf("7");

    if(member == 6 && rank == 1) { format(rstring,80,"Praktikant"); }
    else if(member == 6 && rank == 2) { format(rstring,80,"Ausbilder"); }
    else if(member == 6 && rank == 3) { format(rstring,80,"Senior Ausbilder"); }
    else if(member == 6 && rank == 4) { format(rstring,80,"Manager"); }
    else if(member == 6 && rank == 5) { format(rstring,80,"Unter Boss"); }
    else if(member == 6 && rank == 6) { format(rstring,80,"Boss"); }
    printf("8");


    if(adminlevel == 0) { format(asstring,80,"Kein Admin"); }
    else if(adminlevel == 1) { format(asstring,80,"Adminlevel 1"); }
    else if(adminlevel == 2) { format(asstring,80,"Adminlevel 2"); }
    else if(adminlevel == 3) { format(asstring,80,"Adminlevel 3"); }
    else if(adminlevel == 4) { format(asstring,80,"Adminlevel 4"); }
    else if(adminlevel == 5) { format(asstring,80,"Owner/Co-Owner"); }
    printf("9");


    if(member == 0) { format(fname,80,"Zivilist"); }
    else if(member == 1) { format(fname,80,"Polizei"); }
    else if(member == 2) { format(fname,80,"Sanitäter"); }
    else if(member == 3) { format(fname,80,"Las Camoras"); }
    else if(member == 4) { format(fname,80,"The Black Hand"); }
    else if(member == 5) { format(fname,80,"News Reporter"); }
    else if(member == 6) { format(fname,80,"Fahrschule"); }
    if(fleader == 0) { format(jleader,80,"Nein"); }
    else if(fleader == 1) { format(jleader,80,"Ja"); }
    if(pa == 0) { format(pstring,80,"Nein"); }
    else if(pa == 1) { format(pstring,80,"Ja"); }
    printf("10");

    if(pInfo[playerid][autoschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][autoschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][bootsschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][bootsschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][truckschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][truckschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][motorradschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][motorradschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][quadschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][quadschein] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][freischwimmer] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][freischwimmer] == 1) { format(astring,80,"Vorhanden"); }
    if(pInfo[playerid][flugzeugschein] == 0) { format(astring,80,"Nicht vorhanden!"); }
    else if(pInfo[playerid][flugzeugschein] == 1) { format(astring,80,"Vorhanden"); }
    printf("11");

    GetPlayerName(playerid, plname, sizeof(plname));
    printf("12");
    format(sstring,sizeof(sstring),"Adminlevel:[%s]\nGeld:[%d]\nBank:[%d]\nPremium:[%s]\nHandynummer:[%d]\nGuthaben:[%d]\nFraktion:[%s]\nFraktionsrank:[%s]\nFraktionsleader:[%s]\nJob:[%s]\nAlter: Wochen:[%d] Monate:[%d] Jahre:[%d]\nZeit bis du älter wirst:[%d]",asstring,pInfo[playerid][geld],pInfo[playerid][pBank],pstring,pInfo[playerid][pHandyNr],pInfo[playerid][pHCash],fname,rstring,jleader,jstring,pInfo[playerid][wochen],pInfo[playerid][monate],pInfo[playerid][jahre],pInfo[playerid][payday]);
    printf("13");

    format(sstring1,sizeof(sstring1),"{FF9600}Autoführerschein: [%s] Strafpunkte: [%d/6] Bootsführerschein: [%s] Strafpunkte: [%d/6]\nLKW Führerschein: [%s] Strafpunkte: [%d/6] Motorradführerschein: [%s] Strafpunkte[%d/6]\nQuadführerschein: [%s] Strafpunkte[%d/6] Freischwimmer: [%s] Strafpunkte[%d/6]\nFlugführerschein: [%s] Strafpunkte[%d/6]",astring,pInfo[playerid][apunkte],astring,pInfo[playerid][bpunkte],astring,pInfo[playerid][tpunkte],astring,pInfo[playerid][mpunkte]);
    printf("14");


    format(sstring2,sizeof(sstring1),"Quadführerschein: [%s] Strafpunkte:[%d/6] Freischwimmer: [%s] Strafpunkte: [%d/6]\nFlugführerschein: [%s] Strafpunkte: [%d/6]{FAFAFA}",astring,pInfo[playerid][qpunkte],astring,pInfo[playerid][freipunkte],astring,pInfo[playerid][flugpunkte]);
    printf("15");


    format(sstringverbindung, (sizeof string), "%s\n%s\n%s",sstring,sstring1);
    printf("16");


    format(snstring,sizeof(snstring),"Dein Stats:%s",plname);
    printf("17");
    ShowPlayerDialog(playerid,37,DIALOG_STYLE_MSGBOX,snstring,sstringverbindung,"OK", "Abbrechen");

    return 1;
    }
    Habs jetzt so wenn ich /stats eingebe steht nichts in der Console.
    Es gibt keine Warnings/Errors.
    mfg


    Bewerte mich und meine Transaktionen als Mittelsmann

  • Hey Versuch es Mal so:::
    if(strcmp(cmdtext,"/stats", cmdtext, true, 10) == 0)
    Villt Geht es Jetz...

  • Was ist da jetzt anders?


    if (strcmp(cmdtext, "/stats", true) == 0)


    so sollte das funktionieren

    "Bevor ich mir Informationen aus der "Bild" hole,
    werde ich anfangen, Wahlergebnisse danach vorauszusagen,
    neben welchen Busch unsere Katze gepinkelt hat."

    Margarete Stokowski

  • if(strcmp("/stats", cmdtext, true, 10) == 0)
    {
    printf("1");
    new snstring[250],sstring[250],plname[MAX_PLAYER_NAME],fleader = pInfo[playerid][leader],member = pInfo[playerid][team],fname[256],jleader[256],pstring[250],pa = pInfo[playerid][premium];
    printf("2");
    new rank = pInfo[playerid][frank],rstring[256],adminlevel = pInfo[playerid][admin],asstring[250],jstring[250], job = pInfo[playerid][pjob],sstring1[250],sstring2[250],sstringverbindung[500],astring[50];
    printf("3");
    if(job == 1) { format(jstring,80,"Straßenkehrer"); }
    printf("4");


    Mach mal so vermutlich hat er probs die ganzen Sachen zu erstellen in dem Befehl
    Das passiert öfter wenn du soviele strings erstellst

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen