Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 3 из 3
  1. #1
    Аватар для Vasya_Pupkin
    Пользователь

    Статус
    Оффлайн
    Регистрация
    13.02.2016
    Сообщений
    77
    Репутация:
    0 ±

    не правильно работает инвентарь

    Всем еще раз привет вот новая проблема
    теперь когда переносишь оружие в нужную клетку и кликаешь по этой клетке несколько раз то оружие которое находиться в этой клетке умножается на 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;
            }
        }
    }
    Последний раз редактировалось Vasya_Pupkin; 13.02.2016 в 18:38. Причина: обновил вопрос

  2. #2
    Аватар для Kurbanoff
    Пользователь

    Статус
    Оффлайн
    Регистрация
    10.08.2015
    Сообщений
    73
    Репутация:
    2 ±
    Сначала делай табуляцию
    level in scripting: beginner

  3. #3
    Аватар для Vasya_Pupkin
    Пользователь

    Статус
    Оффлайн
    Регистрация
    13.02.2016
    Сообщений
    77
    Репутация:
    0 ±
    Чтобы новую тему не создавать обновил первый пост и задал новый вопрос.

 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •