Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

[BUG] Fish Anywhere #17

Open
CxCore-xyz opened this issue Jul 15, 2022 · 2 comments
Open

[BUG] Fish Anywhere #17

CxCore-xyz opened this issue Jul 15, 2022 · 2 comments

Comments

@CxCore-xyz
Copy link

The only problem i found with this scripts is that you can fish anywhere you want even where there isn't any waters. Like in the sand, road, buildings and etc. The best fix would be to make an check wich will check if you're poiting into the waters or something like that. For now i made the -3.0 on the checkcoords to -45.0 Z but theres still some places like mountains where you can abuse this bug. This scripts is amazing but because of this bug it's kinda ruins all the point of it.

@TinyDerp
Copy link

TinyDerp commented Aug 29, 2022

"Found" a sample code to fix this problem. Goes into qb-core/client/functions.lua

function QBCore.Functions.SpawnObject(model, coords, cb)
local model = (type(model) == 'number' and model or GetHashKey(model))

Citizen.CreateThread(function()
    RequestModel(model)
    local obj = CreateObject(model, coords.x, coords.y, coords.z, true, false, true)
    SetModelAsNoLongerNeeded(model)

    if cb then
        cb(obj)
    end
end)

end

function QBCore.Functions.SpawnLocalObject(model, coords, cb)
local model = (type(model) == 'number' and model or GetHashKey(model))

Citizen.CreateThread(function()
    RequestModel(model)
    local obj = CreateObject(model, coords.x, coords.y, coords.z, false, false, true)
    SetModelAsNoLongerNeeded(model)

    if cb then
        cb(obj)
    end
end)

end

function QBCore.Functions.DeleteObject(object)
SetEntityAsMissionEntity(object, false, true)
DeleteObject(object)
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@TinyDerp @CxCore-xyz and others