Hi, I am trying to find out what time something is running
function Pay()
MySQL.Async.fetchAll(
'SELECT * FROM owned_storage WHERE pay = 1', {},
function (result)
for i=1, #result, 1 do
local xPlayer = ESX.GetPlayerFromIdentifier(result[i].owner)
-- message player if connected
if xPlayer ~= nil then
xPlayer.removeBank(result[i].price)
TriggerClientEvent('esx:showNotification', xPlayer.source, _U('paid_storage', result[i].price))
else -- pay either way
MySQL.Sync.execute(
'UPDATE users SET bank = bank - @bank WHERE identifier = @identifier',
{
['@bank'] = result[i].price,
['@identifier'] = result[i].owner
})
end
TriggerEvent('cron:runAt', 1, 0, Pay)
Is this every hour, or every week?