Hello, I explained to you my problem, I want to use a server function of my script everywhere, since I decided to export, my server_export does not work it,
A little help ??
exports[‘entreprise_jobs_hub’]:refrech_jobs_hub();
__resource.lua
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'
ui_page 'html/ui.html'
files {
'html/ui.html',
'html/picture_jobs/brasseur.png',
'html/picture_jobs/ambulancier.png',
'html/picture_jobs/ceralier.png',
'html/picture_jobs/job-icon.png',
'html/picture_jobs/journaliste.png',
'html/picture_jobs/poleemploi.png',
'html/picture_jobs/police.png',
'html/picture_jobs/sherif.png',
'html/picture_jobs/president.png',
'html/picture_jobs/taxi.png',
'html/picture_jobs/mecano.png',
'font/pricedown.ttf'
}
client_script 'client/client.lua'
server_script 'server/server.lua'
server_script '@mysql-async/lib/MySQL.lua'
server_export {
'refrech_jobs_hub'
}
server.lua
function refrech_jobs_hub()
TriggerEvent('entreprise.refesh.status')
end
RegisterServerEvent('entreprise.refesh.status')
AddEventHandler('entreprise.refesh.status', function()
local source = source
local playersSteamID = exports['anti_essential_core']:getIdentifier(source)
local PlayerInfoGetJobsID = MySQL.Sync.fetchAll('SELECT * FROM users WHERE identifier = @identifier', { ['@identifier'] = playersSteamID })
local GetEntrepriseName = MySQL.Sync.fetchAll('SELECT * FROM entreprise WHERE id = @entreprise_id', { ['@entreprise_id'] = PlayerInfoGetJobsID[1].entreprise })
TriggerClientEvent('jobssystem:updateJob', source, GetEntrepriseName[1].custome_name, PlayerInfoGetJobsID[1].grade, GetEntrepriseName[1].entreprise_photo)
end)
Erreur :