SA-MP Forums Archive
[HELP] Left-Right keys. - 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: [HELP] Left-Right keys. (/showthread.php?tid=410684)



[HELP] Left-Right keys. - Thedya - 26.01.2013

Hi guys,

I have a little code but it has some little problem too.. Normally we are using ''NumPad'' for this script but some of my players are using laptops so they can not use it..

I just wanna change that script to normal 'Right and Left' keyboard arrows.. But it doenst work. I gonna lose my mind =) Can anyone help me ?

This is normal 'numpad' code.. I changed ''if(newkeys == KEY_ANALOG_LEFT)'' to if(newkeys == KEY_LEFT)'' bu its not working how can i fix it.. what do i need to do..

Код:
	if(PlayerInfo[playerid][PlayerBuyingSkin] == 1)
	{
	    if(newkeys == KEY_ANALOG_LEFT)
	    {
	        if(GetPlayerSkin(playerid) == 235)
	        {
                SetPlayerSkin(playerid, 202);
			}
	        else if(GetPlayerSkin(playerid) == 202)
	        {
                SetPlayerSkin(playerid, 135);
			}..............
Thanks.


Re: [HELP] Left-Right keys. - Threshold - 26.01.2013

Quote:
Originally Posted by SA-MP Wiki
OnPlayerKeyStateChange will be called each time a key state is changed. It will never be called for up, down, left and right.
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/GetPlayerKeys


Re: [HELP] Left-Right keys. - Vince - 26.01.2013

Quote:
Originally Posted by Thedya
Посмотреть сообщение
but some of my players are using laptops so they can not use it..
Gibberish. The single player uses those keys for the bounce mission. I believe that laptops that don't have a numpad use the O, K, L and ; keys for that. To be on the safe side, just print out the gametext definition for those keys in a client message.



Re: [HELP] Left-Right keys. - Thedya - 27.01.2013

O K L and ; do not work ?