21.02.2011, 13:24
Hi. Is it possible in the function OnPlayerKeyStateChange to detect if I press a certain key, in this case R?
If I have understood it right the binary code for R is 01010010 (found here: http://www.control.com/thread/1014156798). I tried using it in my code but it didn't work at all.
Should I add " or '? I don't know.
If I have understood it right the binary code for R is 01010010 (found here: http://www.control.com/thread/1014156798). I tried using it in my code but it didn't work at all.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(01010010))
{
if(GetPlayerAmmo(playerid) == 0)
{
SetTimerEx("PistolReload", 3000, false, "d", playerid);
}
else
{
SendClientMessage(playerid, 0xAAAAAAAA, "You are not out of ammo yet");
}
}
return 1;
}