Detect key mapped - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Detect key mapped (
/showthread.php?tid=624583)
Detect key mapped -
Onfroi - 18.12.2016
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.
Re: Detect key mapped -
SickAttack - 18.12.2016
There's only documentation about that in regards to GameTexts and TextDraws, so I suppose not.
https://sampwiki.blast.hk/wiki/Keys
Re: Detect key mapped -
Runn3R - 19.12.2016
No, the ~k~ is part of the game and the chat is built by samp.
Re: Detect key mapped -
CutX - 19.12.2016
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)
Re: Detect key mapped -
Threshold - 19.12.2016
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.");
Re: Detect key mapped -
SickAttack - 19.12.2016
Interesting. I do remember seeing some people do that, but have never tested it before or thought it wouldn't even work.
Re: Detect key mapped -
Runn3R - 19.12.2016
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.
Re: Detect key mapped -
Onfroi - 19.12.2016
Nice, someone should definitely add this to the wiki
Re: Detect key mapped -
CutX - 19.12.2016
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
Re: Detect key mapped -
Onfroi - 19.12.2016
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: