Пользователь
- Регистрация
- 25 Окт 2023
- Сообщения
- 45
- Автор темы
- #1
Developers:ramzandev
MySQL R41-4
Система выполнена на модулях
Лишь основа это
MySQL R41-4
Система выполнена на модулях
Лишь основа это
Код:
forward LoadPlayerItems(playerid);
public LoadPlayerItems(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows)
{
for(new i; i < rows; i++)
{
cache_get_value_name_int(i, "inv_id_base", Inventory[i][inv_id_base]);
cache_get_value_name_int(i, "inv_model", Inventory[i][inv_model]);
cache_get_value_name_int(i, "inv_owner", Inventory[inv_owner]);
cache_get_value_name_int(i, "inv_type", Inventory[inv_type]);
Iter_Add(player_items[playerid], Inventory[inv_model]);
}
}
}
[CODE]
enum
{
TYPE_ITEMS_NONE = 0,
TYPE_ITEMS_SKINS,
TYPE_ITEMS_ACCESSORIES,
TYPE_ITEMS_INVENTORY
}
#define MAX_ITEMS 895
enum Inventory_e
{
inv_id_base,
inv_model,
inv_type,
inv_owner
}
new Inventory[MAX_PLAYERS][Inventory_e];
new PlayerGUIItem[MAX_PLAYERS][MAX_ITEMS];
new Iterator:player_items[MAX_PLAYERS]<MAX_ITEMS-1>;
enum Inventory_value
{
inv_v_model,
inv_v_type,
inv_v_name[42]
}
new Inventory_Value[MAX_ITEMS][Inventory_value]=
{
{1, TYPE_ITEMS_NONE, "FIX"},
{2, TYPE_ITEMS_INVENTORY, "Аптека"},
{2, TYPE_ITEMS_INVENTORY, "Ремка"},
{3, TYPE_ITEMS_INVENTORY, "Тест"}
};
Код:
/*stock ForInventoryDialogToPlayer(playerid, dialogid, response, listitem)
{
return 1;
}*/
CMD:inv(playerid)
{
ShowInventory(playerid, 1);
return 1;
}
stock ShowInventory(playerid, class)
{
if(class == 1)
{
new count, string[256],
fmt_string[256];
foreach(new _v_id:player_items[playerid])
{
new inv_id = Inventory[_v_id][inv_id_base];
format(string, sizeof(string), "%d. %s ()\n", count + 1, Inventory_Value[inv_id][inv_v_name]);
strcat(fmt_string, string);
PlayerGUIItem[playerid][count] = inv_id;
count++;
}
format(string, sizeof(string), "%d. Аксессуары", count + 1);
strcat(fmt_string, string);
PlayerGUIItem[playerid][count] = 100;
show_dialog(playerid, d_inventory, DIALOG_STYLE_LIST, "Инвентарь", fmt_string, "Далее", "Отмена");
}
return 1;
}