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.
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”.
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)
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.