$MaX$
Умник
Доброго времени суток. У меня возникла проблема с сохранением второго (Домашнего) инвентаря. Использую эту систему инвентаря > Динамическая система инвентаря [ TextDraw ] ( Как у RakNet ). Проблема в том что я создаю новые переменные для домашнего инвентаря сохранение и прочее, а как с инвентаря игрока предметы перемещать в домашний инвентарь?
Вот код чтобы перетаскивать предметы
Вот стоки
Новые переменные дома InventoryHouse
Вопрос: Как сделать так чтобы менять предметы например с InventoryPlayer на InventoryHouse?
Буду очень благодарен если поможете.
Вот код чтобы перетаскивать предметы
PHP:
if(playertextid == Inventory[i][playerid])
{
if(GetPVarInt(playerid,"ChangeSlot") == 0)
{
SetPVarInt(playerid,"SelectSlot",i);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] == 0) { }
else
{
SetPVarInt(playerid,"ChangeSlot",GetPVarInt(playerid,"SelectSlot"));
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], 0xFF000050);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
}
}
else if(GetPVarInt(playerid,"ChangeSlot") != 0)
{
SetPVarInt(playerid,"SelectSlot",i);
SendClientMessage(playerid,COLOR_BLUE,string);
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], 0xFFFFFF60);
OpenInventory(playerid);
return 1;
}
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], 0xFFFFFF60);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
UpdateInventory(playerid);
ObjInventory(playerid);
for(new g = 24; g < 31; g++) GiveWeapon(playerid, GetPlayerWeapontInt(Items_All[InventoryPlayer[playerid][invSlot][g]][invObject]),InventoryPlayer[playerid][invKol][g]);
SetPVarInt(playerid,"ChangeSlot",0);
SetPVarInt(playerid,"SelectSlot",0);
return 1;
}
}
PHP:
stock ObjInventory(playerid)
{
if(GetPVarInt(playerid,"ChangeSlot") == GetPVarInt(playerid,"SelectSlot")) return SetPVarInt(playerid,"ChangeSlot",0);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] != 0 && InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] != InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1]) return SetPVarInt(playerid,"ChangeSlot",0);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] == InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1])
{
InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1] = 0;
InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"SelectSlot") - 1] += InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"ChangeSlot") - 1];
InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"ChangeSlot") - 1] = 0;
}
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] == 0)
{
InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] = InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1];
InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"SelectSlot") - 1] = InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"ChangeSlot") - 1];
InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1] = 0;
InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"ChangeSlot") - 1] = 0;
}
return 1;
}
stock UpdateInventory(playerid)
{
if(GetPVarInt(playerid,"ChangeSlot") == GetPVarInt(playerid,"SelectSlot")) return SetPVarInt(playerid,"ChangeSlot",0);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] != 0 && InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"SelectSlot") - 1] != InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1]) return SetPVarInt(playerid,"ChangeSlot",0);
if(InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1] != 0)
{
PlayerTextDrawSetPreviewModel(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], 19000),PlayerTextDrawSetPreviewRot(playerid, Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid], 0.000000, 0.000000, 90.000000, 2.000000);
PlayerTextDrawSetPreviewModel(playerid,Inventory[GetPVarInt(playerid,"SelectSlot")][playerid], Items_All[InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"ChangeSlot") - 1]][invObject]),PlayerTextDrawSetPreviewRot(playerid, Inventory[GetPVarInt(playerid,"SelectSlot")][playerid], -16.000000, -20.000000, -55.000000, 1.100000);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"SelectSlot")][playerid]);
}
return 1;
}
Вопрос: Как сделать так чтобы менять предметы например с InventoryPlayer на InventoryHouse?
Буду очень благодарен если поможете.
