Главная » Статьи » Туториал

Возможность снять рюкзак.

Приветствую уважаемые пользователи сайта mtadayz.ucoz.net

Данный туториал позволит вам снимать рюкзак. Итак приступим.

Открываем файл inventory.lua. Находим:

if itemName == "Бинт" then
            if getElementData(localPlayer,"bleeding") == 0 then
                return
            end
        end

Ниже вставляем:

 if itemName == "Assault Pack (ACU)" and getElementData ( localPlayer, "MAX_Slots" ) == 12 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Patrol Pack" and getElementData ( localPlayer, "MAX_Slots" ) == 20 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Alice Pack" and getElementData ( localPlayer, "MAX_Slots" ) == 27 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Czhezh Backpack" and getElementData ( localPlayer, "MAX_Slots" ) == 30 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Vega Pack" and getElementData ( localPlayer, "MAX_Slots" ) == 36 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Mountain Backpack" and getElementData ( localPlayer, "MAX_Slots" ) == 45 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Coyote Backpack" and getElementData ( localPlayer, "MAX_Slots" ) == 60 then
            itemInfo = "Снять рюкзак"
        end
        if itemName == "Big Backpack" and getElementData ( localPlayer, "MAX_Slots" ) == 75 then
            itemInfo = "Снять рюкзак"
        end

Далее ищем:

 elseif itemInfo == "Взять спец оружие" then
        triggerServerEvent("onPlayerRearmWeapon",localPlayer,itemName,3)

И ниже вставляем:

 elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 12 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 20 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 27 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 30 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 36 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 45 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 60 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 75 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()
        elseif itemInfo == "Снять рюкзак" and getElementData ( localPlayer, "MAX_Slots" ) == 100 then
            if getPlayerCurrentSlots() >= 8 then
                triggerEvent("displayClientInfo", localPlayer, "Инвентарь", "Выложите весь лут из рюказка!", 255, 22, 0)
            else
                setElementData(localPlayer,"MAX_Slots",8)
            end
            refreshInventory()

Напоминаю, что у каждого могут быть свои названия рюкзаков и количества слотов, так что аккуратнее. Спасибо за внимание!

Категория: Туториал | Добавил: Middl (25.06.2015)
Просмотров: 2179 | Теги: туториал, снимать, DayZ, MTA, GTA, Рюкзак, Сервер | Рейтинг: 0.0/0
Всего комментариев: 0
Имя *:
Email *:
Код *: