function onGameInit(ARG_0) UPVALUE0 = game.datastore:GetNumber("missionNumber") UPVALUE1 = CheckPrice(ARG_0, 5, 7) s_merchandise = {} s_merchandise[0] = { s_name = "REFUELA", s_sound = "GasRefuelingSound", n_price = function() return CheckRefuelPrice(UPVALUE0) end, b_visible = CheckVisibility(ARG_0, 2), n_restriction = function(ARG_0, ARG_1) if ARG_1:GetFuelTankCapacity() - ARG_1:GetActualFuel() < UPVALUE0 then return 106 end return 0 end, s_item = false, t_offset = nil, n_range = nil } s_merchandise[1] = { s_name = "REFUELB", s_sound = "GasRefuelingSound", n_price = function() return CheckRefuelPrice(UPVALUE0) end, b_visible = CheckVisibility(ARG_0, 2), n_restriction = function(ARG_0, ARG_1) if ARG_1:GetFuelTankCapacity() - ARG_1:GetActualFuel() < UPVALUE0 then return 106 end return 0 end, s_item = false, t_offset = nil, n_range = nil } s_merchandise[2] = { s_name = "CANISTER", s_sound = "GasCanSound", n_price = function() return 100 + 10 * UPVALUE0 end, b_visible = true, n_restriction = function(ARG_0, ARG_1) if ARG_0:InventoryHaveItem(38) then return 3 end return 0 end, s_item = { "GS_kanistr01", "GS_kanistr02", "GS_kanistr03", "GS_kanistr04", "GS_kanistr05", "GS_kanistr06", "GS_kanistr07", "GS_kanistr08", "GS_kanistr09", "GS_kanistr10" -- добавляем новую канистру в список }, t_offset = { -- добавляем новую координату для новой канистры 0, 0, 0, 0 }, n_range = 0.6 } s_merchandise[3] = { s_name = "WASH", s_sound = false, n_price = function() if UPVALUE0 > 6 or UPVALUE0 < 1 then return 3 else return 5 end end, b_visible = CheckVisibility(ARG_0, 1), n_restriction = function(ARG_0, ARG_1) return 0 end, s_item = false, t_offset = nil, n_range = nil } end

-- убираем функцию Init, так как она не нужна для нашей задачи

function BuyItem(ARG_0, ARG_1, ARG_2) if ARG_2 == 0 then if ARG_0.ctrl.cashRegister then ARG_0.ctrl.cashRegister:AddMoney(s_merchandise[ARG_1].n_userPrice or s_merchandise[ARG_1].n_price()) end if ARG_1 == 0 or ARG_1 == 1 then ARG_0.cfg.refuelingScript:RefuelingStart({ vendorPos = "GasRefuelingProdavacPos0" .. ARG_1, carPos = "GasRefuelingPosition0" .. ARG_1, stojan = UPVALUE0[1], price = s_merchandise[ARG_1].n_userPrice or s_merchandise[ARG_1].n_price() }) elseif ARG_1 == 2 then ARG_0.ctrl.player:InventoryRemoveMoney(s_merchandise[ARG_1].n_userPrice or s_merchandise[ARG_1].n_price()) ARG_0.ctrl.player:InventoryAddItem(38, 0) ARG_0.ctrl.player:InventorySelect(48, false) DeactivateAll(ARG_0, { s_merchandise[ARG_1].s_sound }) ActivateAll(ARG_0, { s_merchandise[ARG_1].s_sound }) if 1 < #s_merchandise[ARG_1].s_item then table.remove(s_merchandise[ARG_1].s_item, #s_merchandise[ARG_1].s_item) end elseif ARG_1 == 3 then ARG_0.ctrl.player:InventoryRemoveMoney(s_merchandise[ARG_1].n_userPrice or s_merchandise[ARG_1].n_price()) ARG_0.ctrl.player:GetOwner():AddSpendedMoney(s_merchandise[ARG_1].n_userPrice or s_merchandise[ARG_1].n_price()) i

Переделай lua скрипт в игре Mafia 2 так чтобы канистра с бензином показывалась и её можно было купить Вот код скрипта function onGameInit_ARG_0_ _UPVALUE0_ = gamedatastoreGetNumbermissionNumber _UPV

原文地址: https://www.cveoy.top/t/topic/dJra 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录