Unknown command

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
  • Hi, ich habe mein inventory system fertig gescriptet und wollte es ingame testen. als ich den befehl "/inv" eingegeben habe kam dan unknown command.. kann mir jmd helfen?



    if(strcmp(cmdtext,"/inv",true)==0)
    {
    new string1[128];
    if(PlayerInfo[playerid][inventaritem1anzahl] >= 0){format(string1,128,"%i %s",PlayerInfo[playerid][inventaritem1anzahl],PlayerInfo[playerid][inventaritem1]);}
    new string2[128];
    if(PlayerInfo[playerid][inventaritem2anzahl] >= 0){format(string2,128,"%i %s",PlayerInfo[playerid][inventaritem2anzahl],PlayerInfo[playerid][inventaritem2]);}
    new string3[128];
    if(PlayerInfo[playerid][inventaritem3anzahl] >= 0){format(string3,128,"%i %s",PlayerInfo[playerid][inventaritem3anzahl],PlayerInfo[playerid][inventaritem3]);}
    new string4[128];
    if(PlayerInfo[playerid][inventaritem4anzahl] >= 0){format(string4,128,"%i %s",PlayerInfo[playerid][inventaritem4anzahl],PlayerInfo[playerid][inventaritem4]);}
    new string5[128];
    if(PlayerInfo[playerid][inventaritem5anzahl] >= 0){format(string5,128,"%i %s",PlayerInfo[playerid][inventaritem5anzahl],PlayerInfo[playerid][inventaritem5]);}
    new string6[128];
    if(PlayerInfo[playerid][inventaritem6anzahl] >= 0){format(string6,128,"%i %s",PlayerInfo[playerid][inventaritem6anzahl],PlayerInfo[playerid][inventaritem6]);}
    new string7[128];
    if(PlayerInfo[playerid][inventaritem7anzahl] >= 0){format(string7,128,"%i %s",PlayerInfo[playerid][inventaritem7anzahl],PlayerInfo[playerid][inventaritem7]);}
    new string8[128];
    if(PlayerInfo[playerid][inventaritem8anzahl] >= 0){format(string8,128,"%i %s",PlayerInfo[playerid][inventaritem8anzahl],PlayerInfo[playerid][inventaritem8]);}
    new string9[128];
    if(PlayerInfo[playerid][inventaritem9anzahl] >= 0){format(string9,128,"%i %s",PlayerInfo[playerid][inventaritem9anzahl],PlayerInfo[playerid][inventaritem9]);}
    new string10[128];
    if(PlayerInfo[playerid][inventaritem10anzahl] >= 0){format(string10,128,"%i %s",PlayerInfo[playerid][inventaritem10anzahl],PlayerInfo[playerid][inventaritem10]);}
    new string11[128];
    if(PlayerInfo[playerid][inventaritem11anzahl] >= 0){format(string11,128,"%i %s",PlayerInfo[playerid][inventaritem11anzahl],PlayerInfo[playerid][inventaritem11]);}
    new string12[128];
    if(PlayerInfo[playerid][inventaritem12anzahl] >= 0){format(string12,128,"%i %s",PlayerInfo[playerid][inventaritem12anzahl],PlayerInfo[playerid][inventaritem12]);}
    new string13[128];
    if(PlayerInfo[playerid][inventaritem13anzahl] >= 0){format(string13,128,"%i %s",PlayerInfo[playerid][inventaritem13anzahl],PlayerInfo[playerid][inventaritem13]);}
    new string14[128];
    if(PlayerInfo[playerid][inventaritem14anzahl] >= 0){format(string14,128,"%i %s",PlayerInfo[playerid][inventaritem14anzahl],PlayerInfo[playerid][inventaritem14]);}
    new string15[128];
    if(PlayerInfo[playerid][inventaritem15anzahl] >= 0){format(string15,128,"%i %s",PlayerInfo[playerid][inventaritem15anzahl],PlayerInfo[playerid][inventaritem15]);}
    new string16[128];
    if(PlayerInfo[playerid][inventaritem16anzahl] >= 0){format(string16,128,"%i %s",PlayerInfo[playerid][inventaritem16anzahl],PlayerInfo[playerid][inventaritem16]);}
    new string17[128];
    if(PlayerInfo[playerid][inventaritem17anzahl] >= 0){format(string17,128,"%i %s",PlayerInfo[playerid][inventaritem17anzahl],PlayerInfo[playerid][inventaritem17]);}
    new string18[128];
    if(PlayerInfo[playerid][inventaritem18anzahl] >= 0){format(string18,128,"%i %s",PlayerInfo[playerid][inventaritem18anzahl],PlayerInfo[playerid][inventaritem18]);}
    new string19[128];
    if(PlayerInfo[playerid][inventaritem19anzahl] >= 0){format(string19,128,"%i %s",PlayerInfo[playerid][inventaritem19anzahl],PlayerInfo[playerid][inventaritem19]);}
    new string20[128];
    if(PlayerInfo[playerid][inventaritem20anzahl] >= 0){format(string20,128,"%i %s",PlayerInfo[playerid][inventaritem20anzahl],PlayerInfo[playerid][inventaritem20]);}
    new string21[128];
    if(PlayerInfo[playerid][inventaritem21anzahl] >= 0){format(string21,128,"%i %s",PlayerInfo[playerid][inventaritem21anzahl],PlayerInfo[playerid][inventaritem21]);}
    new string22[128];
    if(PlayerInfo[playerid][inventaritem22anzahl] >= 0){format(string22,128,"%i %s",PlayerInfo[playerid][inventaritem22anzahl],PlayerInfo[playerid][inventaritem22]);}
    new string23[128];
    if(PlayerInfo[playerid][inventaritem23anzahl] >= 0){format(string23,128,"%i %s",PlayerInfo[playerid][inventaritem23anzahl],PlayerInfo[playerid][inventaritem23]);}
    new string24[128];
    if(PlayerInfo[playerid][inventaritem24anzahl] >= 0){format(string24,128,"%i %s",PlayerInfo[playerid][inventaritem24anzahl],PlayerInfo[playerid][inventaritem24]);}
    new string25[128];
    if(PlayerInfo[playerid][inventaritem25anzahl] >= 0){format(string25,128,"%i %s",PlayerInfo[playerid][inventaritem25anzahl],PlayerInfo[playerid][inventaritem25]);}
    new stringalle[2500];
    format(stringalle,2500,"%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",string1,string2,string3,string4,string5,string6,string7,string8,string9,string10,string11,string12,string13,string14,string15,string16,string17,string18,string19,string20,string21,string22,string23,string24,string25);
    ShowPlayerDialog(playerid,DIALOG_INVENTAR,DIALOG_STYLE_LIST,"Inventar",stringalle,"Weiter","Abbrechen");
    return 1;
    }

  • if(!strcmp(cmdtext,"/inv",true))
    {
    new string[1024];//ggf. erhöhen
    if(PlayerInfo[playerid][inventaritem1anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem1anzahl],PlayerInfo[playerid][invetaritem1]);
    else if(PlayerInfo[playerid][inventaritem2anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem2anzahl],PlayerInfo[playerid][inventaritem2]);
    else if(PlayerInfo[playerid][inventaritem3anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem3anzahl],PlayerInfo[playerid][inventaritem3]);
    else if(PlayerInfo[playerid][inventaritem4anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem4anzahl],PlayerInfo[playerid][inventaritem4]);
    else if(PlayerInfo[playerid][inventaritem5anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem5anzahl],PlayerInfo[playerid][inventaritem5]);
    else if(PlayerInfo[playerid][inventaritem6anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem6anzahl],PlayerInfo[playerid][inventaritem6]);
    else if(PlayerInfo[playerid][inventaritem7anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem7anzahl],PlayerInfo[playerid][inventaritem7]);
    else if(PlayerInfo[playerid][inventaritem8anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem8anzahl],PlayerInfo[playerid][inventaritem8]);
    else if(PlayerInfo[playerid][inventaritem9anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem9anzahl],PlayerInfo[playerid][inventaritem9]);
    else if(PlayerInfo[playerid][inventaritem10anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem10anzahl],PlayerInfo[playerid][inventaritem10]);
    else if(PlayerInfo[playerid][inventaritem11anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem11anzahl],PlayerInfo[playerid][inventaritem11]);
    else if(PlayerInfo[playerid][inventaritem12anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem12anzahl],PlayerInfo[playerid][inventaritem12]);
    else if(PlayerInfo[playerid][inventaritem13anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem13anzahl],PlayerInfo[playerid][inventaritem13]);
    else if(PlayerInfo[playerid][inventaritem14anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem14anzahl],PlayerInfo[playerid][inventaritem14]);
    else if(PlayerInfo[playerid][inventaritem15anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem15anzahl],PlayerInfo[playerid][inventaritem15]);
    else if(PlayerInfo[playerid][inventaritem16anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem16anzahl],PlayerInfo[playerid][inventaritem16]);
    else if(PlayerInfo[playerid][inventaritem17anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem17anzahl],PlayerInfo[playerid][inventaritem17]);
    else if(PlayerInfo[playerid][inventaritem18anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem18anzahl],PlayerInfo[playerid][inventaritem18]);
    else if(PlayerInfo[playerid][inventaritem19anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem19anzahl],PlayerInfo[playerid][inventaritem19]);
    else if(PlayerInfo[playerid][inventaritem20anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem20anzahl],PlayerInfo[playerid][inventaritem20]);
    else if(PlayerInfo[playerid][inventaritem21anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem21anzahl],PlayerInfo[playerid][inventaritem21]);
    else if(PlayerInfo[playerid][inventaritem22anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem22anzahl],PlayerInfo[playerid][inventaritem22]);
    else if(PlayerInfo[playerid][inventaritem23anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem23anzahl],PlayerInfo[playerid][inventaritem23]);
    else if(PlayerInfo[playerid][inventaritem24anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem24anzahl],PlayerInfo[playerid][inventaritem24]);
    else if(PlayerInfo[playerid][inventaritem25anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem25anzahl],PlayerInfo[playerid][inventaritem25]);
    ShowPlayerDialog(playerid,DIALOG_INVENTAR,DIALOG_STYLE_LIST,"Inventar",string,"Weiter","Abbrechen");
    return 1;
    }
    Bitteschön.
    Die String-Größe musst du ggf. erhöhen.
    EDIT: Einrückung scheiße :thumbdown:

  • if(!strcmp(cmdtext,"/inv",true))
    {
    print("/inv - Anfang");
    new string[1024];//ggf. erhöhen
    if(PlayerInfo[playerid][inventaritem1anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem1anzahl],PlayerInfo[playerid][invetaritem1]);
    else if(PlayerInfo[playerid][inventaritem2anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem2anzahl],PlayerInfo[playerid][inventaritem2]);
    else if(PlayerInfo[playerid][inventaritem3anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem3anzahl],PlayerInfo[playerid][inventaritem3]);
    else if(PlayerInfo[playerid][inventaritem4anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem4anzahl],PlayerInfo[playerid][inventaritem4]);
    else if(PlayerInfo[playerid][inventaritem5anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem5anzahl],PlayerInfo[playerid][inventaritem5]);
    else if(PlayerInfo[playerid][inventaritem6anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem6anzahl],PlayerInfo[playerid][inventaritem6]);
    else if(PlayerInfo[playerid][inventaritem7anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem7anzahl],PlayerInfo[playerid][inventaritem7]);
    else if(PlayerInfo[playerid][inventaritem8anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem8anzahl],PlayerInfo[playerid][inventaritem8]);
    else if(PlayerInfo[playerid][inventaritem9anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem9anzahl],PlayerInfo[playerid][inventaritem9]);
    else if(PlayerInfo[playerid][inventaritem10anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem10anzahl],PlayerInfo[playerid][inventaritem10]);
    else if(PlayerInfo[playerid][inventaritem11anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem11anzahl],PlayerInfo[playerid][inventaritem11]);
    else if(PlayerInfo[playerid][inventaritem12anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem12anzahl],PlayerInfo[playerid][inventaritem12]);
    else if(PlayerInfo[playerid][inventaritem13anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem13anzahl],PlayerInfo[playerid][inventaritem13]);
    else if(PlayerInfo[playerid][inventaritem14anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem14anzahl],PlayerInfo[playerid][inventaritem14]);
    else if(PlayerInfo[playerid][inventaritem15anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem15anzahl],PlayerInfo[playerid][inventaritem15]);
    else if(PlayerInfo[playerid][inventaritem16anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem16anzahl],PlayerInfo[playerid][inventaritem16]);
    else if(PlayerInfo[playerid][inventaritem17anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem17anzahl],PlayerInfo[playerid][inventaritem17]);
    else if(PlayerInfo[playerid][inventaritem18anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem18anzahl],PlayerInfo[playerid][inventaritem18]);
    else if(PlayerInfo[playerid][inventaritem19anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem19anzahl],PlayerInfo[playerid][inventaritem19]);
    else if(PlayerInfo[playerid][inventaritem20anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem20anzahl],PlayerInfo[playerid][inventaritem20]);
    else if(PlayerInfo[playerid][inventaritem21anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem21anzahl],PlayerInfo[playerid][inventaritem21]);
    else if(PlayerInfo[playerid][inventaritem22anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem22anzahl],PlayerInfo[playerid][inventaritem22]);
    else if(PlayerInfo[playerid][inventaritem23anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem23anzahl],PlayerInfo[playerid][inventaritem23]);
    else if(PlayerInfo[playerid][inventaritem24anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem24anzahl],PlayerInfo[playerid][inventaritem24]);
    else if(PlayerInfo[playerid][inventaritem25anzahl] >= 0)format(string,128,"%s%i %s\n",string,PlayerInfo[playerid][inventaritem25anzahl],PlayerInfo[playerid][inventaritem25]);
    ShowPlayerDialog(playerid,DIALOG_INVENTAR,DIALOG_STYLE_LIST,"Inventar",string,"Weiter","Abbrechen");
    print("/inv - Ende - Dialog anzeigen");
    return 1;
    }
    Mache das mal, und schaue was in der Konsole geschrieben wird.