Aşağı da vereceğim event ile ister target'a yerleştirin ister komut olarak kullanın.
Kod kod satırı halinde ve tek bir kordinatta çalışır.
Kod kod satırı halinde ve tek bir kordinatta çalışır.
Kod:
RegisterNetEvent("kdepo", function()
local PlayerData = QBCore.Functions.GetPlayerData(source)
local playerPed = PlayerPedId()
if PlayerData.job.name == "police" then
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Kdepo_"..QBCore.Functions.GetPlayerData().citizenid, QBCore.Key, { maxweight =100, slots = 20, })
TriggerEvent("inventory:client:SetCurrentStash","Kdepo_"..QBCore.Functions.GetPlayerData().citizenid)
else
QBCore.Functions.Notify("Polis değilsin ki la", "primary", length)
end
end)
Kod:
RegisterCommand('kdepo',function(source)
local PlayerData = QBCore.Functions.GetPlayerData(source)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
if DoesEntityExist(playerPed) then
coords = GetEntityCoords(playerPed)
if GetDistanceBetweenCoords(coords, 479.1297, -996.6594, 30.67, true) < 100.0 then
if PlayerData.job.name == "police" then
TriggerServerEvent("inventory:server:OpenInventory", "stash", "Kdepo_"..QBCore.Functions.GetPlayerData().citizenid, QBCore.Key, { maxweight =100, slots = 20, })
TriggerEvent("inventory:client:SetCurrentStash","Kdepo_"..QBCore.Functions.GetPlayerData().citizenid)
end
else
QBCore.Functions.Notify("bu alanda kişisel depona ulaşamazsın!")
end
end
end)