Citizen.CreateThread(function()
for i=1, #jobsSelling do
exports["gr-base"]:pedcreate("sellnpc-"..jobsSelling[i]["item"], jobsSelling[i]["ped"], jobsSelling[i]["coords"].x, jobsSelling[i]["coords"].y, jobsSelling[i]["coords"].z, jobsSelling[i]["heading"])
exports["gr-base"]:addNotif(jobsSelling[i]["icon"], "E", jobsSelling[i]["draw-3d"], 2, 2, vector3(jobsSelling[i]["coords"].x, jobsSelling[i]["coords"].y, jobsSelling[i]["coords"].z))
end
while true do
time = 3000
if QBCore then
for i=1, #jobsSelling do
local playerPed = PlayerPedId()
local playerCoords = GetEntityCoords(playerPed)
local distance = #(playerCoords - jobsSelling[i]["coords"])
if distance < 2 then
time = 1
if IsControlJustReleased(0,38) then
local keyboard = exports["qb-core"]:KeyboardInput({
header = "Eşya Sat",
rows = { { id = 0, txt = "Kaç adet satmak istiyorsunuz?" } }
})
if tonumber(keyboard[1].input) <= 0 then -- 0 dan küçük değer girerse
QBCore.Functions.Notify("Lütfen 0'dan büyük bir sayı değeri giriniz.")
else
exports['progressbar']:Progress({
name = "satis",
duration = 2000,
label = 'Satılıyor..',
useWhileDead = false,
canCancel = false,
controlDisables = {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
},
},
function()
TriggerServerEvent('startSelling', jobsSelling[i]["item"], tonumber(keyboard[1].input), jobsSelling[i]["money"], QBCore.Key)
end)
end
end
end
end
end
Citizen.Wait(time)
end
end)