local boat = GetVehiclePedIsIn(PlayerPedId(), false)
if not boat or not IsThisModelABoat(GetEntityModel(boat)) then return end
-- Check if we can anchor the boat here
if CanAnchorBoatHere(boat) then
-- Deploy the boat's anchor
SetBoatAnchor(boat, true)
-- Wait for 10 seconds
Wait(10000)
-- Raise the boat's anchor
SetBoatAnchor(boat, false)
else
print("Cannot anchor the boat at this location")
end