Detecting Player Key Config
#1

how can i detect a key that the player configured example default crouch key is c if it is changed to numpad0 i want to know how i can detect that...

heres a picture example




Reply
#2

There is no way to detect numpad0 by default unless they have it as an available key. However you can give the player a list of available configurable keys to choose from and log it as a variable.
See:
wiki.sa-mp.com/wiki/Keys

Oh I misunderstood. You can't, however you can use the k string that is available to show the GameText string for the key that's set in their client, however you cannot actually get the key they have.

See:
wiki.sa-mp.com/wiki/GameTextForPlayer
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
There is no way to detect numpad0 by default unless they have it as an available key.
edit:

if key attack is lmb and the textdraw says press lmb to close i want to change the textdraw to whatever key the player changed it to...

it is very possible as you can see in the screen shots i took from crazybobs cops and robbers
Reply
#4

Use the ~k~ code - https://sampwiki.blast.hk/wiki/Keys

This is changed by San Andreas into the key they configured locally. All you do is use the ~k~ code, so ~k~~PED_FIREWEAPON~ is for LMB (although if they had changed it, it'd say different)
Reply
#5

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
Use the ~k~ code - https://sampwiki.blast.hk/wiki/Keys

This is changed by San Andreas into the key they configured locally. All you do is use the ~k~ code, so ~k~~PED_FIREWEAPON~ is for LMB (although if they had changed it, it'd say different)
thank you + rep exactly the answer i was looking for
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)