RegisterKeyMapping and Resource Name Change not updating fivem.cfg

Hi,

I’ve recently run into a potential bug with RegisterKeyMapping. Upon a resource name change the fivem.cfg file that stores all of the bound keys and the pointer to the resource/function does not update.

This was all tested on the default server with no other resources other than what is outlined in the Setting up a server doc.

Version:
version
OneSync:
onesync

Steps to reproduce:

  1. Start the resource
  2. Press K
  3. See output
  4. Disconnect
  5. Bring server down
  6. Rename resource to something else
  7. Start server
  8. Start the renamed resource
  9. Connect to server
  10. Press K
  11. No output

Example Script (GitHub)

Configuration File (%appdata%\citizenfx)
Without name change fivem.cfg (6.8 KB)

With resource name change fivem.cfg (6.8 KB)

Output
Without resource name change

With resource name change

Key binding menu
Without resource name change

With resource name change

If you need any more info just sing out.

Pretty sure key info saves locally, so you’d need to clear your cache.

What?

a) this is a bug report topic, not a support question
b) settings are not even stored in ‘cache’, as the guy already posted in his post
c) literally, what’s with the obsession with ‘clearing cache’ and ‘reinstalling’ and then people only getting more issues when doing such?

As to the bug itself, haven’t had time to check yet but it might be the case something is missing an IsTagActive check.

1 Like

Right - seems to be fixed by adding such checks.

1 Like

My apologies mate. My ignorance :slight_smile:

Appreciate the quick fix! :slight_smile: