Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@TinyDerp @CxCore-xyz and others