[Free] [Standalone] Hookers

Would it be possible for an ND Framework compatible option for payments too. A lot of standalone users use it.
Here are the functions like addMoney and stuff!

I’m not as well versed with lua as you or I’d just do it myself from scratch but maybe this documentation can help

If you are using esx, please download the resource again (from GitHub) as I forgot to uncomment the function that actually got the money… Yes it was that simple.

I added ND core as an option, could you possibly test if it works?

1 Like

so I assume this is esx then? I added to mine but never could fine the girls.-

The spawn for the girls is done by scenario files that are loaded. So, default girls. Try near Franklin’s aunt house, near strip club, the beach, etc. If you’re using a script or resource to control or stream scenarios, then it’s possible they’ve been modified to remove these “girls”.

It supports esx/qbcore/ndcore but it could also be used standalone

Just as a note to anyone downloading this script in the future: This requires game build 2060 or higher to function due to the usage of game events.

1 Like

You can enforce your gamebuild to 2060 by doing a quick read up here:

:sunglasses:

Sorry got busy here is error

[      script:hookers] SCRIPT ERROR: Execution of native 000000002f7a49e6 in script host failed: Argument at index 1 was null.
[      script:hookers] > [global chunk] (TriggerClientEventInternal.lua:3)
[      script:hookers] > handler (@hookers/server.lua:45)
[      script:hookers] > <unknown> (@oxmysql/dist/build.js:22252)
[      script:hookers] > processTicksAndRejections (node:internal/process/task_queues:96)

The hooker will take the money and then just sits there and nothing happens.

Hmm… I suppose source became nil somehow?

What if you declare src = source on line 19 in server.lua and then replace source with src like so:

RegisterServerEvent('hookers:moneyCheck')
AddEventHandler('hookers:moneyCheck', function(service)
    local cost = Config.Prices[service]
    local src = source -- Maybe this needs to be declared?

    if Config.Framework == "esx" then
        local xPlayer = ESX.GetPlayerFromId(src)
        local cash = xPlayer.getMoney()

        if cash >= cost then
            xPlayer.removeMoney(cost)
            TriggerClientEvent('hookser:paymentReturn', src, true)
        else
            TriggerClientEvent('hookser:paymentReturn', src, false)
        end
    elseif Config.Framework == "qbcore" then
        local Player = QBCore.Functions.GetPlayer(src)
        local cash = Player.Functions.GetMoney('cash')

        if cash >= cost then
            Player.Functions.RemoveMoney('cash', cost, "Hooker")
            TriggerClientEvent('hookser:paymentReturn', src, true)
        else
            TriggerClientEvent('hookser:paymentReturn', src, false)
        end
    elseif Config.Framework == "ndcore" then
        local character = NDCore.Functions.GetPlayer(src)

        if character.cash >= cost then
            NDCore.Functions.DeductMoney(cost, src, "cash", "Hooker")
            TriggerClientEvent('hookser:paymentReturn', src, true)
        else
            TriggerClientEvent('hookser:paymentReturn', src, false)
        end
    elseif Config.Framework == "standalone" then
        -- Your code here
        TriggerClientEvent('hookser:paymentReturn', src, true)
    else
        TriggerClientEvent('hookser:paymentReturn', src, true)
    end
end)

is this only client side or server sided as well? could give cops some roleplay for vice ops seeing someone picking up a hooker lol

Yes, it’s synced between players.


It’s a little dark, but here’s an example of how it looks for other players.

Mads, give the man some privacy! :rofl::rofl:

1 Like

Well, technically it’s Michael that is watching! I’m actually innocent! :smile:

Amanda and the tennis coach :joy:

Where do they spawn?

The hookers spawn in the “regular” places, the script in itself does not handle the spawning of the peds at all. So if you have scenarios blocked or have suppressed the ped model then you’ll either have to force spawn them somewhere, or disable the model suppression or scenario remover.

EYO! THIS SCRIPT :skull::skull::skull: is …

Nice work Mads

1 Like

Thanks!