RegisterNUICallback("PutIntoChest", function(data, cb) if type(data.number) == "number" and math.floor(data.number) == data.number then INserver.putIntoChest({data.item.name,data.number}) cb("ok") end end) RegisterNUICallback("TakeFromChest", function(data, cb) if type(data.number) == "number" and math.floor(data.number) == data.number then INserver.takeFromChest({data.item.name,data.number}) cb("ok") end end) Citizen.CreateThread(function () while true do local wait = 1000 local pedCoords = GetEntityCoords(PlayerPedId()) for name, dep in pairs(Config.Depozite) do for _, pos in pairs(dep.positions) do if (#(pedCoords - pos) < 5.0) then wait = 1 DrawMarker(dep.markerId,pos.x,pos.y,pos.z-0.95,0,0,0,0,0,0,1.0,1.0,1.0,dep.markerColor[1],dep.markerColor[2],dep.markerColor[3],255,false, false, false, true, false, false, false) if #(pedCoords - pos) <= 1.0 then if dep.label == nil then dep.label = name end Draw3DText(pos, "Press ~b~[E]~w~ to open " .. dep.label) if IsControlJustPressed(0, 51) then INserver.openDeposit({name, pos}) end end end end end Citizen.Wait(wait) end end) function vRPin.isIsideACar() return IsPedSittingInAnyVehicle(PlayerPedId()) or (GetVehiclePedIsEntering(PlayerPedId()) ~= 0) end Citizen.CreateThread(function () while true do local wait = 1000 local ped = PlayerPedId() local pedCoords = GetEntityCoords(ped) for name, chest in pairs(Config.Chests) do if #(pedCoords - chest.position) < 5.0 then wait = 1 DrawMarker(chest.markerId,chest.position.x,chest.position.y,chest.position.z-0.95,0,0,0,0,0,0,1.0,1.0,1.0,chest.markerColor[1],chest.markerColor[2],chest.markerColor[3],255,false, false, false, true, false, false, false) if #(pedCoords - chest.position) <= 1.0 then if chest.label == nil then chest.label = name end Draw3DText(chest.position, "Press ~b~[E]~w~ to open " .. chest.label) if IsControlJustPressed(0, 51) then INserver.openChest({name, chest.position}) end end end end Citizen.Wait(wait) end end)