13.05.2014, 01:05
Something like this;
If anyone else knows a more efficient way, please reply.
pawn Код:
new bool: crouching[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH)
{
crouching[playerid] = true;
}
if(newkeys & KEY_SPRINT) || (newkeys & KEY_CROUCH) && (newkeys & KEY_FIRE))
{
if(crouching[playerid])
{
crouching[playerid] = false;
}
}
return 1;
}