- Katılım
- 2 yıl 7 ay 22 gün
- Mesajlar
- 116
madde x soygun yerine gittiğimde kırmızı işaret gelmiyor saatleri ayarladım ama bir türlü gelmiyor yardımcı olursanız sevinirim (client ve server lua yı bırakıyorum)
Kod:
CLİENT.LUA
local markerCoord = vector3(5266.37, -5427.52, 65.61)
local blipCoords = vector3(5266.37, -5427.52, 65.61)
local markerCoord = vector3(2448.037109375, 4983.23046875, 46.846790313721)
local blipCoords = vector3(2448.037109375, 4983.23046875, 46.846790313721)
local itemSure, canAzaltmaTetikle = 0, 0 -- 90
local PlayerData = {}
local iceride, inZone = false, false
local zone = PolyZone:Create({
vector2(-1556.8288574219, 240.71723937988),
vector2(-1535.7277832031, 197.61943054199),
vector2(-1537.5841064453, 195.62873840332),
vector2(-1592.0213623047, 169.30766296387),
vector2(-1615.4320068359, 220.47302246094),
vector2(-1564.3182373047, 244.01776123047),
}, {
name="xdepo",
minZ = 56.358386993408,
maxZ = 70.881610870361
})
QBCore = nil
Citizen.CreateThread(function()
while QBCore == nil do
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
Citizen.Wait(200)
end
coreLoaded = true
QBCore.Functions.TriggerCallback('tgiann-illegalev-2:sure-cek', function(data, coord, day)
Config.Data = data
markerCoord = coord
if day then
local evBlip = AddBlipForCoord(blipCoords)
SetBlipSprite(evBlip, 84)
SetBlipDisplay(evBlip, 2)
SetBlipScale(evBlip, 0.7)
SetBlipColour(evBlip, 1)
SetBlipAsShortRange(evBlip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("X Deposu")
EndTextCommandSetBlipName(evBlip)
end
end)
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
inZone = zone:isPointInside(GetEntityCoords(PlayerPedId()))
end
end)
exports("inZone", function()
return inZone
end)
RegisterNetEvent('QBCore:Client:OnPlayerLoaded')
AddEventHandler('QBCore:Client:OnPlayerLoaded', function()
PlayerData = QBCore.Functions.GetPlayerData()
end)
-- Meslek Update
RegisterNetEvent('QBCore:Client:OnJobUpdate')
AddEventHandler('QBCore:Client:OnJobUpdate', function(job)
PlayerData.job = job
end)
RegisterNetEvent("tgiann-illegalev-2:senkron-data")
AddEventHandler("tgiann-illegalev-2:senkron-data", function(data)
Config.Data = data
end)
Citizen.CreateThread(function()
while true do
local sure = 1500
local PlayerPed = PlayerPedId()
local oyuncuKordinat = GetEntityCoords(PlayerPed)
if inZone and coreLoaded then
if PlayerData.job == nil then PlayerData = QBCore.Functions.GetPlayerData() end
icerdemiFunction(true)
if PlayerData.job and PlayerData.job.name ~= "police" and PlayerData.job.name ~= "ambulance" then
local inVeh = IsPedInAnyVehicle(PlayerPed)
if inVeh then
SetEntityHealth(PlayerPed, GetEntityHealth(PlayerPed)-5)
QBCore.Functions.Notify("Araçta Olduğun İçin Canın Gidiyor!", "error")
else
sure = 1
local markermesafe = #(markerCoord - oyuncuKordinat)
if markermesafe < 20 and Config.Data.tgiannktif then
DrawMarker(20, markerCoord.x, markerCoord.y, markerCoord.z-0.6, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 1.0, 1.0, 1.0, 255, 0,0, 100, false, true, 2, false, false, false, false)
if markermesafe < 2.0 then
if IsControlJustPressed(1, 38) then
QBCore.Functions.TriggerCallback('tgiann-illegalev-2:sure-cek', function(data)
Config.Data = data
if not Config.Data.sureBasladi and not Config.Data.esyaAlinabilir then
TriggerServerEvent("tgiann-illegalev-2:sure-baslat", QBCore.Key)
elseif Config.Data.esyaAlinabilir and not Config.Data.esyaAlindi then
TriggerServerEvent("tgiann-illegalev-2:esya-alindi", QBCore.Key)
QBCore.Functions.Notify("Aldın")
end
end)
end
QBCore.Functions.DrawText3D(markerCoord.x, markerCoord.y, markerCoord.z, Config.Data.yazi, 0.45)
end
end
end
else
if canAzaltmaTetikle <= 8 then
canAzaltmaTetikle = canAzaltmaTetikle + 1
if PlayerData.job and PlayerData.job.name == "police" or PlayerData.job.name == "ambulance" then
QBCore.Functions.Notify("Burada işin yok. ".. 10 - canAzaltmaTetikle .. " Saniye Sonra Canın Gitmeye Başlayacak", "error")
SetEntityHealth(PlayerPed, GetEntityHealth(PlayerPed)-5)
end
end
end
else
icerdemiFunction(false)
end
Citizen.Wait(sure)
end
end)
function icerdemiFunction(data)
canAzaltmaTetikle = 0
if data and not iceride then
iceride = true
QBCore.Functions.Notify("Gergin Hissediyorsun...", "error")
TriggerEvent("tgiann-polisbidirim:bildirim-aktif", false)
TriggerEvent("tigann-kelepce:aktif-pasif", false)
TriggerEvent("tgiann-stres:stres-aktif", false)
AnimpostfxPlay("MenuMGSelectionTint", 1000, true)
elseif not data and iceride then
iceride = false
QBCore.Functions.Notify("Rahatlamaya Başladın...", "success")
TriggerEvent("tgiann-polisbidirim:bildirim-aktif", true)
TriggerEvent("tigann-kelepce:aktif-pasif", true)
TriggerEvent("tgiann-stres:stres-aktif", true)
AnimpostfxStop("MenuMGSelectionTint")
end
end
Kod:
SERVER LUA
QBCore = nil
TriggerEvent('QBCore:GetObject', function(obj) QBCore = obj end)
local day = true
local randomZone = vector3(-1558.2067871094, 215.74842834473, 60.254039764404)
local zones = {
vector3(-1558.2067871094, 215.74842834473, 60.254039764404),
vector3(-1555.2557373047, 200.59162902832, 60.254035949707),
vector3(-1572.9921875, 192.92764282227, 60.254203796387),
vector3(-1593.9682617188, 200.21858215332, 60.25403213501),
vector3(-1597.6584472656, 215.87094116211, 60.254035949707),
vector3(-1588.4893798828, 221.01454162598, 60.254039764404),
vector3(-1574.0268554688, 214.24642944336, 60.253978729248),
vector3(-1566.2960205078, 229.58459472656, 60.404037475586),
vector3(-1575.0600585938, 205.79293823242, 63.054702758789),
vector3(-1559.9107666016, 216.22868347168, 64.455215454102),
vector3(-1565.5286865234, 227.76737976074, 64.455070495605),
vector3(-1580.1103515625, 217.01864624023, 64.582931518555),
vector3(-1574.3214111328, 214.12141418457, 64.455146789551),
vector3(-1596.4593505859, 214.85803222656, 64.455215454102),
vector3(-1588.7305908203, 221.36618041992, 64.455192565918),
vector3(-1573.8980712891, 193.76341247559, 68.65648651123),
vector3(-1587.7578125, 188.84616088867, 68.65633392334),
vector3(-1591.6472167969, 211.48385620117, 68.65633392334),
vector3(-1565.4697265625, 228.89920043945, 68.656288146973),
vector3(-1558.8337402344, 212.09722900391, 68.65641784668),
}
Citizen.CreateThread(function()
randomZone = zones[math.random(1, #zones)]
while true do
if not tgiannktif then
local date = os.date("*t")
if date.day == 5 or date.day == 12 or date.day == 19 or date.day == 26 then
day = true
if date.hour == 22 and date.min > 30 and date.min < 40 then
startEvent()
end
else
break
end
end
Citizen.Wait(300000)
end
end)
RegisterCommand("ieb", function(source)
if source == 0 then
startEvent()
end
end)
RegisterCommand("iek", function(source)
if source == 0 then
stopEvent()
end
end)
RegisterServerEvent('tgiann-illegalev-2:sure-baslat')
AddEventHandler('tgiann-illegalev-2:sure-baslat', function(key)
if QBCore.Functions.kickHacKer(source, key) then -- QBCore.Key
if Config.BeklemeSuresi == Config.Data.itemSure then
Config.Data.sureBasladi = true
Config.Data.yazi = "Eşya Hazırlanıyor..."
senkronData()
TriggerClientEvent("QBCore:Notify", source, "Geri Sayım Başladı! " .. QBCore.Shared.Round((Config.Data.itemSure/1000)/60, 2) .. " Dakika Bekle!", "primary", 15000)
while Config.Data.itemSure > 1 do
Config.Data.itemSure = Config.Data.itemSure - 1000
Citizen.Wait(1000)
end
Config.Data.yazi = "[E] Eşyayı Al"
Config.Data.esyaAlinabilir = true
senkronData()
end
end
end)
QBCore.Functions.CreateCallback('tgiann-illegalev-2:sure-cek', function(source, cb)
cb(Config.Data, randomZone, day)
end)
RegisterServerEvent('tgiann-illegalev-2:esya-alindi')
AddEventHandler('tgiann-illegalev-2:esya-alindi', function(key)
local src = source
if QBCore.Functions.kickHacKer(src, key) then -- QBCore.Key
if Config.Data.esyaAlinabilir then
local xPlayer = QBCore.Functions.GetPlayer(src)
if xPlayer then
Config.Data.esyaAlinabilir = false
Config.Data.esyaAlindi = true
Config.Data.sureBasladi = false
Config.Data.yazi = "Eşyayı Birisi Aldı"
senkronData()
xPlayer.Functions.AddItem("madde_x", 150)
TriggerClientEvent("QBCore:Notify", src, "25 Tane Madde X Aldın!")
TriggerEvent('DiscordBot:ToDiscord', 'eventpara', 'X Deposu / MaddeX (25)', src)
end
Citizen.Wait(900000)
stopEvent()
else
TriggerClientEvent("QBCore:Notify", src, "Eşyası Başkası Aldı!", "Error")
end
end
end)
function startEvent()
Config.Data.tgiannktif = true
Config.Data.itemSure = Config.BeklemeSuresi
Config.Data.yazi = "[E] Eşyayı Kontrol Et",
senkronData()
end
function stopEvent()
Config.Data = {
tgiannktif = false,
esyaAlindi = false,
esyaAlinabilir = false,
sureBasladi = false,
itemSure = 0,
yazi = "[E] Eşyayı Kontrol Et",
}
senkronData()
end
function senkronData()
TriggerClientEvent("tgiann-illegalev-2:senkron-data", -1, Config.Data)
end