09.07.2016, 10:35
Код:
public ListPlayerItems(playerid) { new list_items[2048], item_count = Iter_Count(PlayerItem[playerid]), item_weight, item_weight_sum; format(list_items, sizeof(list_items), "UID\tNazwa przedmiotu\tWaga\n \t» Funkcja zaznaczania\n \t» Przedmioty w pobliżu\n---\n"); printf("ListPlayerItems[1]"); foreach(new itemid : PlayerItem[playerid]) { printf("ListPlayerItems[2]: %d", itemid); if(PlayerItemCache[playerid][itemid][iUID]) { printf("ListPlayerItems[3]: %d", itemid); item_weight = GetPlayerItemWeight(playerid, itemid); if(PlayerItemCache[playerid][itemid][iUsed]) { format(list_items, sizeof(list_items), "%s\n{FFFFFF}%d\t{C0C0C0}%s\t%dg", list_items, PlayerItemCache[playerid][itemid][iUID], PlayerItemCache[playerid][itemid][iName], item_weight); } else { format(list_items, sizeof(list_items), "%s\n{C0C0C0}%d\t{C0C0C0}%s\t%dg", list_items, PlayerItemCache[playerid][itemid][iUID], PlayerItemCache[playerid][itemid][iName], item_weight); } item_weight_sum += item_weight; printf("ListPlayerItems[4]: %d", itemid); } } printf("ListPlayerItems[5]"); if(item_count > 0) { new title[256]; format(title, sizeof(title), "Lista Twoich przedmiotуw [ilość: %d | suma wag: %dg]", item_count, item_weight_sum); ShowPlayerDialog(playerid, D_ITEM_USE, DIALOG_STYLE_TABLIST_HEADERS, title, list_items, "Użyj", "Opcje..."); } else { TD_ShowSmallInfo(playerid, 5, "Nie posiadasz ~r~zadnych ~w~przedmiotow w ekwipunku."); } printf("ListPlayerItems[6]"); return 1; }
Код:
[12:25:19] ListPlayerItems[1] [12:25:19] ListPlayerItems[2]: 0 [12:25:19] ListPlayerItems[3]: 0 [12:25:19] ListPlayerItems[4]: 0 [12:25:19] ListPlayerItems[2]: 1 [12:25:19] ListPlayerItems[3]: 1 [12:25:19] ListPlayerItems[4]: 1 [12:25:19] ListPlayerItems[2]: 2 [12:25:19] ListPlayerItems[3]: 2 [12:25:19] ListPlayerItems[4]: 2 [12:25:19] ListPlayerItems[2]: 5 [12:25:19] ListPlayerItems[2]: 8 [12:25:19] ListPlayerItems[2]: 11 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14 [12:25:19] ListPlayerItems[2]: 14
That's all is after using iter_saferemove of course in checking items.