SA-MP Forums Archive
[HELP]Key codes? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Key codes? (/showthread.php?tid=44641)



[HELP]Key codes? - Ignas1337 - 25.07.2008

I'd like to know what are the codes for numbers on keyboard that are above letters. I need numbers from 1 to 8 and letters' O and B codes. IF anyone can point me to a web with something like that or say instantly please do. I am making a CS-Imitation

edit:

i've found something but it's way not the way I saw it in SA-MP:



Re: [HELP]Key codes? - boemeles - 25.07.2008

you can't, look in a_samp.inc for possible key states


Re: [HELP]Key codes? - Ignas1337 - 25.07.2008

Quote:
Originally Posted by [ЯЈ®†
$!7ЈС©!Х™ ]
you can't, look in a_samp.inc for possible key states
a_samp.inc doesn't have ALL keys... IT has sprint, jump, crouch arrow keys, a few else. but I need exactly 1,2,3,4,5,6,7,8,o,b. valuse. I've found osmething but it's not the way in a_samp.inc


Re: [HELP]Key codes? - Cueball - 25.07.2008

You can't detect all button presses, instead you can detect the SA keys, such as sprint, movement, jump, etc. Many people have asked to be able to detect other non-SA keys, but it is currently impossible.

~Cueball~



Re: [HELP]Key codes? - Ignas1337 - 25.07.2008

BUT IT ISS!!!! I can make something like...
pawn Code:
OnPlayerKeyStateChange(playerid, oldkeys, newkeys)
{
 new string[256];
 format(string, sizeof(string), "oldkeys: %d, newkeys: %d", oldkeys, newkeys);
 SendClientMessage(playerid, COLOR_SYSTEM, string);
}
D'oh!!! How I haven't thought of this!?


Re: [HELP]Key codes? - Ignas1337 - 25.07.2008

yeah yeah, lol tested before you posted, lol. 'aight. Anyway we can't do it huh? ;(
I choose MTA then, it lets you use ANY key for ANY purpose...

but i'll come back to sa-mp after I finish the CS mode


Re: [HELP]Key codes? - Ignas1337 - 17.05.2009

ah, just thought of it. It would be possible to make a plugin to scan the keys and then return the value to the script where I could check if player has pressed it or not and do whatnot, hmm


Re: [HELP]Key codes? - Backwardsman97 - 17.05.2009

Ok, this topics only like...a year old. :P


Re: [HELP]Key codes? - Ignas1337 - 17.05.2009

yea, just found it that I posted it earlier and thought of a way to solve it!!


Re: [HELP]Key codes? - Badger(new) - 17.05.2009

The only defined keys are these ones: https://sampwiki.blast.hk/wiki/GetPlayerKeys#Key_List

if You really need the keys defined, you could just do something where you type the key.


Re: [HELP]Key codes? - Ignas1337 - 17.05.2009

no, that doesn't matter... anyway, i beleave it's possible to use a plugin to send information about key pressed to the script and I will try to do something ike that. wish me luck