Question

проблема со слотами, я сделал надевание/снятие аксессуаров по перемещению, переместив аксессуар в специальный слот

- он одевается, но если я в инвентаре перемещу аксессуар с этой же костью - то надетаый аксессуар снимется

Спойлер

                    if(pInfo[playerid][pInventory][j] == 0 && ClickInv[playerid] != -1 && pInfo[playerid][pActivTrade][ClickInv[playerid]] == 0)
                    {
                        new id = ClickInv[playerid];
                        if(j != 0 && j != 1 && j != 2 && j != 3 && j != 4 && j != 5)
                        {
                            if(ItemsInfo[pInfo[playerid][pInventory][id]][Access] == 1
                            {
                                pInfo[playerid][pSlotItem][ItemsInfo[pInfo[playerid][pInventory][id]][AcessBone]] 0// записываем ид обьекта в слот
                                RemovePlayerAttachedObject(playerid, ItemsInfo[pInfo[playerid][pInventory][id]][AcessBone]);
                                save_slotitem(playerid);
                                ClickInv[playerid] = -1;
                            }
                        }
                        if(j >= 0 && j <= 5) {
                            if(ItemsInfo[pInfo[playerid][pInventory][id]][Access] == 0) {
                                ShowPlayerDialog(playerid,D_NULL,DIALOG_STYLE_MSGBOX, ""colserver"Инвентарь",""colwhi"Этот предмет не является аксессуаром","Закрыть","");
                                PlayerTextDrawBackgroundColor(playerid, inventory_slot[playerid][ClickInv[playerid]], 505290495);
                                PlayerTextDrawShow(playerid, inventory_slot[playerid][ClickInv[playerid]]);
                                ClickInv[playerid] = -1;
                                return true;
                            }
                            if(IsPlayerAttachedObjectSlotUsed(playerid, ItemsInfo[pInfo[playerid][pInventory][id]][AcessBone])) {
                                ShowPlayerDialog(playerid,D_NULL,DIALOG_STYLE_MSGBOX, ""colserver"Инвентарь",""colwhi"Выбранная часть тела уже занята, освободите ее","Закрыть","");
                                PlayerTextDrawBackgroundColor(playerid, inventory_slot[playerid][id], 505290495);
                                PlayerTextDrawShow(playerid, inventory_slot[playerid][ClickInv[playerid]]);
                                ClickInv[playerid] = -1;
                                return true;
                            }
                            pInfo[playerid][pSlotItem][ItemsInfo[pInfo[playerid][pInventory][id]][AcessBone]] ItemsInfo[pInfo[playerid][pInventory][id]][ItemModel]; // записываем ид обьекта в слот
                            AtachPlayerAcces(playerid, ItemsInfo[pInfo[playerid][pInventory][id]][ItemModel], GetPlayerSkin(playerid));
                            save_slotitem(playerid);
                        }
 
                        pInfo[playerid][pInventory][j] = pInfo[playerid][pInventory][id];
                        pInfo[playerid][pInventoryKolvo][j] = pInfo[playerid][pInventoryKolvo][id];
                        pInfo[playerid][pInventory][id] = 0;
                        pInfo[playerid][pInventoryKolvo][id] = 0;
 
                        PlayerTextDrawBackgroundColor(playerid, inventory_slot[playerid][id], 505290495);
 
                        InvUpdate(playerid, j, pInfo[playerid][pInventory][j]);
 
                        if(id < 5 && j < 0)  InvUpdate(playerid, id, pInfo[playerid][pInventory][id]);
                        if(id > 5 && j > 5)  InvUpdate(playerid, id, pInfo[playerid][pInventory][id]);
                        //
                        if(id >= 0 && id <= 5) InvUpdate(playerid, id, pInfo[playerid][pInventory][id]);
                        if(j >= 0 && j <= 5) InvUpdate(playerid, id, pInfo[playerid][pInventory][id]); // обновляем предыдущую ячейку
 
                        SaveInventory(playerid);
                        ClickInv[playerid] = -1;
                        break;
                    }

 

 

Edited by hokageud

Share this post


Link to post

0 answers to this question

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0