‘No such export’ despite setup properly and inline with cfx syntax
cmrncs opened this issue · 4 comments
Hi!
I am learning LUA, and currently in development of a radial menu that my players can use to perform emotes, actions and in this case, I am attempting to implement a part of the menu that allows medics to revive using it. Because this is a separate resource, I am using exports to access the functions within the esx_ambulancejob resource. However, despite to my belief the script is throwing an error when attempting to access the GetDeath() function within esx_ambulancejob.
The exact error message I am recieving is:
https://i.imgur.com/V8VCpRf.png
and here is a partial part of the radial menu:
ESX = nil
Citizen.CreateThread(function()
while true do
Wait(5)
if ESX ~= nil then
else
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
end
end
end)
local isJudge = false
local isPolice = false
local isMedic = false
local isDoctor = false
local isNews = false
local isInstructorMode = false
local myJob = "unemployed"
local isHandcuffed = false
local isHandcuffedAndWalking = false
local hasOxygenTankOn = false
local gangNum = 0
local cuffStates = {}
rootMenuConfig = {
{
id = "general",
displayName = "General",
icon = "#globe-europe",
enableMenu = function()
fuck = exports["esx_ambulancejob"]:GetDeath()
return not fuck
end,
subMenus = {"general:flipvehicle", "general:checkoverself", "general:checktargetstates", "general:keysgive", "general:emotes", "general:checkvehicle", "general:apartgivekey", "general:aparttakekey" }
},
Here is my fxmanifest.lua for the st_menu resource:
client_script {
"config.lua",
"client_menu.lua",
"emotes_triggers.lua"
}
export "esx_ambulancejob"
ui_page "html/ui.html"
files {
"html/ui.html",
"html/css/RadialMenu.css",
"html/js/RadialMenu.js",
'html/css/all.min.css',
'html/js/all.min.js',
'html/webfonts/fa-brands-400.eot',
'html/webfonts/fa-brands-400.svg',
'html/webfonts/fa-brands-400.ttf',
'html/webfonts/fa-brands-400.woff',
'html/webfonts/fa-brands-400.woff2',
'html/webfonts/fa-regular-400.eot',
'html/webfonts/fa-regular-400.svg',
'html/webfonts/fa-regular-400.ttf',
'html/webfonts/fa-regular-400.woff',
'html/webfonts/fa-regular-400.woff2',
'html/webfonts/fa-solid-900.eot',
'html/webfonts/fa-solid-900.svg',
'html/webfonts/fa-solid-900.ttf',
'html/webfonts/fa-solid-900.woff',
'html/webfonts/fa-solid-900.woff2',
}
Any and all help is appreciated. I am willing to try anything and everything again, as I have tried many solutions to this to no avail.
Thanks in advance, Cameron.
If esx_ambulancejob
is supposed to export GetDeath
, but doesn't, how is that a problem with
cfx-server-data?
This looks like an issue with esx_ambulancejob
. Please contact the respective author.
Exports seems to work fine for the ambulance job, I am purely asking for support on the exports usage, as I seem to be doing everything fine, yet it is still not working. I figured this hub would have experts and could possibly give me a hand.
THanks