This commit is contained in:
Nordi98 2025-07-13 21:34:52 +02:00
parent 453b25b260
commit 59951edece
9 changed files with 901 additions and 1 deletions

View file

@ -0,0 +1,20 @@
local QBCore = exports['qb-core']:GetCoreObject()
local anchoredBoats = {}
QBCore.Functions.CreateCallback('sg-boatanchor:server:isBoatAnchored', function(source, cb, boatNetId)
if anchoredBoats[boatNetId] then
cb(anchoredBoats[boatNetId].anchored)
else
cb(false)
end
end)
RegisterNetEvent('sg-boatanchor:server:setAnchor', function(boatNetId, isAnchored)
local Player = QBCore.Functions.GetPlayer(source)
if Player and boatNetId then
anchoredBoats[boatNetId] = {
anchored = isAnchored
}
TriggerClientEvent('sg-boatanchor:client:setAnchoredBoats', -1, anchoredBoats)
end
end)