How to bind commands? Like what we used to do in MTA

Hello, so I’m thinking if there’s any way to bind commands like back in MTA.

For example like “bind k kill”, to elaborate more like if there’s a command in a certain server like “/takehostage” and like type in F8 “bind k takehostage” then it works.

is that possible in FiveM like it was possible in MTA?

bind keyboard k command, yeah.

I tried that, and it doesn’t work it says “cmd Argument count mismath (passed2, wanted 3)”

So what’s the solution?

The “solution” is to pass the right amount of arguments.

Again:

bind keyboard k "say whatever"
1 Like

and how so? like I’m new to Fivem so take me easy, like how to pass the right amount of arguments? Like by spamming it? or how? Please elaborate more. Thanks a lot.

Use it correctly as shown above. “keyboard” is needed to specify the right input mapper.

Alright thanks, and what about the command to unbind that certain command? Is it also “unbind keyboard k kill”?

unbind keyboard k I believe.