[HELP] Key ID's (Or what ever it's called)

Hey, i’m making a resource, but i need some help. I’m trying to make something happen when someone clicks a key. (in the keyboard) but i don’t know how. i know LUA uses specific numbers instead of writing “E” , so i’d like to know where i can find the list of the numbers?
Sorry if i’m not explaining myself correctly :disappointed:

IsControlJustPressed(1, 86) 

replace 86 with desired key

Ugh. No no no no!

@yosang please see [HELP] Why cant I get this client / server trigger working?

What do you mean by no? I shouldn’t use that list he sent me?

If you read the comment (and the ones below it), you will see why I said “no”.

If you don’t wan to click it:

OK. Sorry It didn’t redirect me to your comment. I understand now. Thanks

As usual, it’s still not exactly clear. And no one actually explains the simple part. The mods here literally give the shortest posts, with the least information possible. I’ve never seen a mod use more then 40 words in a post. It’s always half answers, half answer without explaination, or just ‘no’ or a riddle you have to figure out.

FiveM lets you bind on actions/events, not the key itself. Lets say you want to use left shift, you don’t bind left shift, you link it to input_sprint, which is usually left shift. If the user changes the sprint key to M, then your code changes with it, because it’s still input_sprint.

Which lets you insert/change code for sprinting, without having to know what key they are using. People can bind sprint to ANY key, and your code still works, because it’s bound to “input_sprint” not left_shift.

Which is a little confusing at first, interesting way to do it, but I’ve created mods in maybe 10 different online games, first time I’ve ever seen it done that way, but I like it.

But it gets even more complicated. If you’re in a car, walking, flying a helicopter, looking at your phone, the same key can do very different things. If you go bind keys in the gtav settings screen, you basically pick the category and edit the key. It would be nice to have a list of each valid input for that input group. I know you can just go look in the game, but to see it broken down would be good.

EDIT: Actually now that I think about it, arma 2 sorta had a similar thing. Like if there was a hacker on, you could start typing a chat message and that would protect you, because you were in like UI Display handle 87 or something. And most code just assumed the normal gameplay UI state (findDisplay 46). So you could attach code/events during special UI cases, not just on keys. There were like 30-40 different screen displays and if the code didn’t match the display it wouldn’t trigger. But that system was fucking stupid. SQF modders holla :heart_eyes:

10 Likes