SA-MP Forums Archive
Keyboard commands assistance please. - 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: Keyboard commands assistance please. (/showthread.php?tid=88322)



Keyboard commands assistance please. - Paladin - 25.07.2009

So .. I've read almost everything I could until I was blue in the face about this key story.. basically I'm wanting to create something that when someone presses their up key, it sends them a message saying "Woop woop", can some one assist me and tell me where I'm going wrong:

Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys == KEY_UP)
	{
	SendClientMessage(playerid, COLOR_YELLOW, "Woop Woop");
  }
}
Thanks in advanced!


Re: Keyboard commands assistance please. - paytas - 25.07.2009

The direction keys aren't detected because they are pressed almost constantly by players, producing too much data to be sent from clients and too much work for this server callback. So there is the function GetPlayerKeys.