Closed omeking2013 closed 3 years ago
Starting the resource last solved this for me. Had it starting as very first before tho.
Starting the resource last solved this for me. Had it starting as very first before tho.
Can confirm starting it last does help... otherwise same issue.
The modules I was starting after this one are: start dpemotes start RealisticVehicleFailure start fh4speed
Just for context maybe they are in conflict.
After asking someone about it they told me:
It’s due to the fact the NUI inits before before game scripts.
on('onClientResourceStart', resourceName => { if (GetCurrentResourceName() != resourceName) { return; } init(); });
The resource only initializes the NUI callbacks after the script is fully started.
Not sure if the fix would require a rework of the existing system but I don’t think starting the resource last is a reliable workaround tbh.
Here’s a screenshot of the dev tools:
Yeah I just got the error even when starting it last
Same here
in resources.cfg
start fivem-appearance restart fivem-appearance
the error will go away
After asking someone about it they told me:
It’s due to the fact the NUI inits before before game scripts.
on('onClientResourceStart', resourceName => { if (GetCurrentResourceName() != resourceName) { return; } init(); });
The resource only initializes the NUI callbacks after the script is fully started.
Not sure if the fix would require a rework of the existing system but I don’t think starting the resource last is a reliable workaround tbh.
Here’s a screenshot of the dev tools:
I have also tried this but is not working, also tried putting the resource last and restart it, also doesnt work
Did anyone ever manage to fix this error?
I didn't for the moment I'm using this resource and starting it last that works most of the time while it still can crash sometimes. So I just need to watch out when starting the server for that. If what has been said here is true it's an easy fix tho just didn't have time myself to try to look into it and fix it for real.
I didn't for the moment I'm using this resource and starting it last that works most of the time while it still can crash sometimes. So I just need to watch out when starting the server for that. If what has been said here is true it's an easy fix tho just didn't have time myself to try to look into it and fix it for real.
Yeah I tried that but it didn't work I mostly work with lua not js or HTML so I was hoping someone had an example of how that fix should be done otherwise I'm probably gonna spend the next few days banging my head against a wall till I figure it out
How I'm not able to reproduce this? I'm joining the server with the resource already running.
Using the latest release.
server.cfg
ensure fivem-appearance
ensure test
test resource
RegisterCommand(
"customization",
() => {
globalThis.exports["fivem-appearance"].startPlayerCustomization((appearance) => {
console.log(appearance);
});
},
false
);
setr fivem-appearance:locale "en"
ensure fivem-appearance
RegisterCommand('customization', function()
local config = {
ped = true,
headBlend = true,
faceFeatures = true,
headOverlays = true,
components = true,
props = true
}
Citizen.Wait(1000)
exports['fivem-appearance']:startPlayerCustomization(function (appearance)
if (appearance) then
TriggerServerEvent('fivem-appearance:save', appearance)
print('Saved')
else
print('Canceled')
end
end, config)
end, false)
This is how I've got it and it throw's this error on login
Is this fixed after c7458d259633b7fbc31d2d098b13ef0d07ed5829?
Error when join the server and ui wont appear how to fix?? (1.1.0 version)