Blumlaut / EasyAdmin

Admin Menu for FiveM and RedM
https://easyadmin.readthedocs.io/
GNU Affero General Public License v3.0
172 stars 156 forks source link

The EA menu doesnt work on REDM #843

Closed Brunodare-coder closed 5 months ago

Brunodare-coder commented 5 months ago

WARNING: IF YOU DO NOT FILL OUT OR REMOVE THE TEMPLATE YOUR ISSUE WILL GET LOCKED!

Describe the issue

I have done all correctly and the error code appeared as lua49: attempt to call a nil value (global registerkeymapping)

Attempted Solutions

the key bind is not working on REDM, I have set the key on the server.ctg and it hasn't worked

Screenshots/Logs

If applicable, attach screenshots or log files here to help explain your problem. setr ea_defaultKey "PhotoModePc"

error

Server Infos (please complete the following information):

Live Console FIVE: RedM (Linux) #628142

Additional context

Add any other context about the problem here.

Blumlaut commented 5 months ago

https://github.com/Blumlaut/EasyAdmin/blob/master/client/admin_client.lua#L48

this is probably getting triggered too early as the rdr3 test only happens once the resource has fully started

can you try adding

if CompendiumHorseObserved then -- https://www.youtube.com/watch?v=r7qovpFAGrQ
    RedM = true
    settings.button = "PhotoModePc"
end

above it? does the error disappear then?

Brunodare-coder commented 5 months ago
code

Is it correct like that ?

if not RedM then RegisterKeyMapping('easyadmin', 'Open EasyAdmin', 'keyboard', "") end

if CompendiumHorseObserved then RedM = true settings.button = "PhotoModePc" end

Brunodare-coder commented 5 months ago
error03

I got this error now put it above like that:

photo03
Blumlaut commented 5 months ago

ah right, settings are initialised later, that code should probably be moved elsewhere, I'll look at rewriting that bit once I get near an rdr3 install.

Blumlaut commented 5 months ago

Please test this commit: https://github.com/Blumlaut/EasyAdmin/commit/7ce86e5ec9162bc6ede94aebc1205f132535efe0 @Brunodare-coder, it registers the keybind later, which should fix the issue.

Blumlaut commented 5 months ago

reminder -- @Brunodare-coder please test the commit above or I will revert it, I don't have a machine capable of running rdr3 currently.

Blumlaut commented 5 months ago

closing this as assumed fixed, author abandoned the issue.