10.10.2016, 02:18
Well, I happen to have this function:
The question is this: suppose there are 20 items, then the function does is check whether the user has items available then show up in inventory, problem or question for me is like for example, if the user has no items the id 0 to 18 but 19 yes.., I would like to detect it in the callback OnDialogResponse with the variable "pInfo[playerid][jItemDispoible][i]"? in this case, the item 19.., thanks
Код:
stock MostrarInventario(playerid) { new name_item[1024]; format(name_item, sizeof(name_item), "{ECEE89}Item\t{ECEE89}Cantidad\t{ECEE89}Peso de item {FFFFFF}(KG)\n"); for(new i = 0; i < MAX_ITEMS; i++) { if(pInfo[playerid][jItem][i] > 0) { new Float:peso = PesoItem(i); format(name_item, sizeof(name_item), "%s%s\t%i\t%.2f\n", name_item, ItemName[i], pInfo[playerid][jItem][i], peso); pInfo[playerid][jItemDispoible][i] = true; } else pInfo[playerid][jItemDispoible][i] = false; } SPD(playerid, DG_INVENTARIO_1, DIALOG_STYLE_TABLIST_HEADERS, "{54FF52}Inventario", name_item, "Aceptar", "Salir"); return true; }