Detect key mapped
#1

So you know how with GameTextForPlayer you can detect what key the player has mapped for SPRINT for example, with the ~k~ symbol (~k~KEY_SPRINT), my question is if there's anyway to detect that with SendClientMessage as well?

Thanks in advance.
Reply
#2

There's only documentation about that in regards to GameTexts and TextDraws, so I suppose not.

https://sampwiki.blast.hk/wiki/Keys
Reply
#3

No, the ~k~ is part of the game and the chat is built by samp.
Reply
#4

so i did something like this
Код:
SendClientMessage(playerid,orange,"[INFO]{FFFFFF} Use {FF00F0}~k~~PED_FIREWEAPON~{FFFFFF} and {FF00F0}~k~~PED_LOCK_TARGET~{FFFFFF} to choose a Car.");
years ago, but i don't have the game installed right now so i can't test.

it must work, cuz if it didn't, why would i've written something like this in the past, wouldn't make sense

so instead of ~k~KEY_SPRINT
you do two more tildes ~k~~PED_SPRINT~ (on foot)
Reply
#5

It should work in client messages. As shown above, I believe all it requires is an additional tilde on either side of the definition. Likely to differentiate it from regular text.

Eg.
PHP код:
SendClientMessage(playerid, -1"Press ~k~~VEHICLE_HORN~ to annoy the driver in front of you."); 
Reply
#6

Interesting. I do remember seeing some people do that, but have never tested it before or thought it wouldn't even work.
Reply
#7

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Interesting. I do remember seeing some people do that, but have never tested it before or thought it wouldn't even work.
me2.
Reply
#8

Nice, someone should definitely add this to the wiki
Reply
#9

Quote:
Originally Posted by Onfroi
Посмотреть сообщение
Nice, someone should definitely add this to the wiki
so does it work, did you test?
like i said, it's been forever since i played last so idon't have it installed

but i'd like to know myself now
Reply
#10

Quote:
Originally Posted by CutX
Посмотреть сообщение
so does it work, did you test?
like i said, it's been forever since i played last so idon't have it installed

but i'd like to know myself now
Yes it does.
Quote:
Originally Posted by Threshold
Посмотреть сообщение
Eg.
PHP код:
SendClientMessage(playerid, -1"Press ~k~~VEHICLE_HORN~ to annoy the driver in front of you."); 
^This turns into this:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)