Binding a command to a key - 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: Binding a command to a key (
/showthread.php?tid=331506)
Binding a command to a key -
Scripter12345 - 05.04.2012
So i have got this.....
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1554.5713,-1675.6034,16.1953))
{
SetPlayerPos(playerid, 246.4274,107.8742,1003.2188);
SetPlayerInterior(playerid, 10);
}
But when i put C instead of "KEY_FIRE" it tells me i need to define C
How would i do that
Please Help Me Please
Re: Binding a command to a key -
antonio112 - 05.04.2012
It's defined "KEY_CROUCH"
pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_CROUCH)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1554.5713,-1675.6034,16.1953))
{
SetPlayerPos(playerid, 246.4274,107.8742,1003.2188);
SetPlayerInterior(playerid, 10);
}
For a full list of keys, use this link:
https://sampwiki.blast.hk/wiki/GetPlayerKeys