PDA

View Full Version : Binding a command to a key


Scripter12345
05/04/2012, 01:16 AM
So i have got this.....


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

antonio112
05/04/2012, 01:22 AM
It's defined "KEY_CROUCH"


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:
http://wiki.sa-mp.com/wiki/GetPlayerKeys