SA-MP Forums Archive
KEY_RIGHT and KEY_LEFT not working? - 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: KEY_RIGHT and KEY_LEFT not working? (/showthread.php?tid=129826)



KEY_RIGHT and KEY_LEFT not working? - iron_war_lord - 23.02.2010

Hey guys

KEY_RIGHT and KEY_LEFT is not working for me...anyone know why?

Код:
new testc, testc2;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if (PRESSED(KEY_RIGHT))
	{
		ChangeVehicleColor(PlayerData[playerid][PlayersCar], testc++, testc2++);
		print("Pressed");
	}
	if (PRESSED(KEY_LEFT))
	{
		ChangeVehicleColor(PlayerData[playerid][PlayersCar], 1,1);
	}
	return 1;
}



Re: KEY_RIGHT and KEY_LEFT not working? - Joe Staff - 23.02.2010

KEY_LEFT, RIGHT, UP, and DOWN don't call OnPlayerKeyStateChange.

You'll have to use GetPlayerKeys(playerid,updown,leftright)