PDA

Просмотр полной версии : [Вопрос] не правильно работает инвентарь



Vasya_Pupkin
13.02.2016, 11:17
Всем еще раз привет вот новая проблема
теперь когда переносишь оружие в нужную клетку и кликаешь по этой клетке несколько раз то оружие которое находиться в этой клетке умножается на 2




for(new i; i < 56; i++)
{
if(playertextid != Inventory[i][playerid]) continue;
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], 0x0000004C);
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")][playerid]);
}
}
else if(GetPVarInt(playerid,"ChangeSlot") != 0)
{
if(playertextid == Inventory[50][playerid])
{
switch(Items_All[InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"changeSlot")-1]][invObject])
{
case 349:GivePlayerWeaponEx(playerid,GetWeaponToObject(Items_All[InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"changeSlot")-1]][invObject]),InventoryPlayer[playerid][invKol][GetPVarInt(playerid,"changeSlot")-1]);
default: return SendClientMessage(playerid,COLOR_RED,""gbError"Этот слот только пп и оружия дальнего боя!"),SetPVarInt(playerid,"changeSlot",-1);
}
}
if(playertextid != Inventory[50][playerid])
{
switch(GetPVarInt(playerid,"changeSlot"))
{
case 50: RemovePlayerWeapon(playerid,GetWeaponToObject(Items_All[InventoryPlayer[playerid][invSlot][GetPVarInt(playerid,"changeSlot")-1]][invObject]));
}
}
SetPVarInt(playerid,"SelectSlot",i);
PlayerTextDrawBackgroundColor(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")-1][playerid], 0xd3d3d3FF);//0x3c3c3cFF
PlayerTextDrawShow(playerid,Inventory[GetPVarInt(playerid,"ChangeSlot")-1][playerid]);
UpdateInventory(playerid);
ObjInventory(playerid);
SetPVarInt(playerid,"ChangeSlot",-1);
SetPVarInt(playerid,"SelectSlot",-1);
return 1;
}
}
}

Kurbanoff
13.02.2016, 13:44
Сначала делай табуляцию (https://ru.wikipedia.org/wiki/%D0%A2%D0%B0%D0%B1%D1%83%D0%BB%D1%8F%D1%86%D0%B8%D1%8F)

Vasya_Pupkin
13.02.2016, 18:39
Чтобы новую тему не создавать обновил первый пост и задал новый вопрос.