28.01.2015, 18:34
I wanna change my hotkey for starting the engine. Right now is "S" hotkey but I want to change it to another key, like "2". How I can do that?
KEY_DOWN
KEY_LOOK_BEHIND
You can only detect ACTIONS, not KEYS. "GetPlayerKeys" and "OnPlayerKeyStateChange" are for that reason poorly named. You can detect when someone presses "jump", but there is no way to determine what key they used to jump, nor is there any way to detect specific keys.
Think of it as "GetPlayerActions" and "OnPlayerActionStateChange", and it will all be much clearer. In this case, there is no way to globally change an action from "S" to "2", because those keys have no meaning to the server. If you just want to change that for YOURSELF, do it from your SA game settings - find the action mapped to "S" and change it to "2". The server will still register the same action, but you are pressing a different key. Alternatively, you can change the action on the server globally from something (such as JUMP) to something else (such as FIRE), but there is no guarantee that either of those keys will be "S" or "2" for any given player. |