11.01.2014, 18:06
Look. When I apply this cmd(with argument or not), pops up error for bad command. What's wrong?
Код:
if(!strcmp(cmdtext, "/p", true)) { new option[7]; if(sscanf(cmdtext, "s[7]", option)) return SendClientMessage(playerid, -1, "Użyj: /p [szukaj/lista]."); //Usage: /p [find/list] if(strcmp(option,"szukaj",true) == 0) { // code.. } else if(strcmp(option,"lista",true) == 0) { new dialog[512], item, amount, idx; while(GetPlayerItems(playerid, idx, item, amount)) { format(dialog, 512, "%s%d x %s (ID:%d)\n", dialog, amount, GetItemName(item), item); } ShowPlayerDialog(playerid, DIALOG_ITEMSGUI, DIALOG_STYLE_LIST, "Przedmioty", dialog, "Wybierz", "Zamknij"); } else SendClientMessage(playerid, -1, "Niepoprawna opcja."); //Bad Option return 1; } //Down of script return ShowPlayerDialog(playerid, DIALOG_CMDBAD, DIALOG_STYLE_MSGBOX, "Błąd!", "Nie ma takiej komendy!", "OK", ""); //Thats pops, this is message if bad cmd }