Fivem | Gom

-- Get player gang QBCore.Functions.CreateCallback('gom:getPlayerGang', function(source, cb) local src = source local Player = QBCore.Functions.GetPlayer(src) local identifier = Player.PlayerData.citizenid

-- Create turf marker Citizen.CreateThread(function() while true do Citizen.Wait(0) local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) gom fivem

exports['gom']:getPlayerGang(src, function(gang) if gang then MySQL.Async.insert('INSERT INTO gom_turfs (gang_id, zone_name, coords_x, coords_y, coords_z) VALUES (@gang_id, @zone, @x, @y, @z)', { ['@gang_id'] = gang.id, ['@zone'] = zoneName, ['@x'] = coords.x, ['@y'] = coords.y, ['@z'] = coords.z }) TriggerClientEvent('QBCore:Notify', src, 'Turf claimed!', 'success') end end) end) -- Get player gang QBCore

CREATE TABLE gom_turfs ( id INT PRIMARY KEY AUTO_INCREMENT, gang_id INT NOT NULL, zone_name VARCHAR(50) NOT NULL, coords_x FLOAT NOT NULL, coords_y FLOAT NOT NULL, coords_z FLOAT NOT NULL, income_rate INT DEFAULT 500, FOREIGN KEY ( gang_id ) REFERENCES gom_gangs ( id ) ); coords_z) VALUES (@gang_id

-- NUI Callbacks RegisterNUICallback('closeStash', function(data, cb) SetNuiFocus(false, false) cb('ok') end)

client_scripts { 'client/*.lua' }

Back to TOP