[Free] [Standalone] Hookers

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!

Update 1.1.0
Some small fixes and improvements, the most notable being that the script now actually unloads the mini@prostitutes@sexnorm_veh anim dict.

Changelog

  • The mini@prostitutes@sexnorm_veh anim is now unloaded by the script after use
  • The script only gets the player ID once, instead of every frame (no need since it will never change)
  • It now loops over the blocked vehicle controls instead of having a bunch of duplicate code
  • Honking is now blocked while interacting with a hooker in your car
  • Added names for the previously unknown ped config flags
  • The script now uses backticks instead of the GetHashKey native
  • source is now stored as a variable (as src) in the hookers:moneyCheck event when it’s triggered, this may fix issues relating to the source suddenly being nil for some people when calling framework functions?