08.12.2014, 18:24
As our colleague above said, use:
Then under OnPlayerKeyStateChange just detect the key that you want and use a redirection, don't repeat the code because there's no need for that at all. Just do it like this:
pawn Код:
// At the top of script under includes:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK) return cmd_door(playerid, "door");
return 1;
}