01.08.2017, 09:39
SA:MP can't detect when a player press 'E', it can only detect when he press a game key.
For example:
Let's say I set my game to jump on SHIFT and sprint on SPACE (which is deafult) and X set his game to jump on SPACE and sprint on SHIFT.
Ok, now when i jump I press SHIFT;
and when X jumps he press SPACE,
but we will both be detected by the server that they pressed 'KEY_JUMP'. So you can't say that all players will jump on SHIFT or sprint on SPACE.
Here is a link to all keys that can be detected and their default value (which can be changed in game by players)
https://sampwiki.blast.hk/wiki/Keys
Unfortunately, there is no default key for 'E' (unless in vehicle), but you can detect when a player press 'C' (KEY_CROUCH); Left alt (KEY_WALK), 'Y' (KEY_YES), 'N' (KEY_NO), etc.
For example:
Let's say I set my game to jump on SHIFT and sprint on SPACE (which is deafult) and X set his game to jump on SPACE and sprint on SHIFT.
Ok, now when i jump I press SHIFT;
and when X jumps he press SPACE,
but we will both be detected by the server that they pressed 'KEY_JUMP'. So you can't say that all players will jump on SHIFT or sprint on SPACE.
Here is a link to all keys that can be detected and their default value (which can be changed in game by players)
https://sampwiki.blast.hk/wiki/Keys
Unfortunately, there is no default key for 'E' (unless in vehicle), but you can detect when a player press 'C' (KEY_CROUCH); Left alt (KEY_WALK), 'Y' (KEY_YES), 'N' (KEY_NO), etc.