changing CMD: to Key
#8

As our colleague above said, use:
pawn Код:
// At the top of script under includes:

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
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 Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        if(newkeys == KEY_SECONDARY_ATTACK)       return cmd_door(playerid, "door");
        return 1;
}
Reply


Messages In This Thread
changing CMD: to Key - by davidstyle1125 - 08.12.2014, 16:37
Re: changing CMD: to Key - by HY - 08.12.2014, 17:00
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:15
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:19
Re: changing CMD: to Key - by Clad - 08.12.2014, 17:30
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:35
Re: changing CMD: to Key - by davidstyle1125 - 08.12.2014, 17:58
Re: changing CMD: to Key - by Rifa4life - 08.12.2014, 18:24
Re: changing CMD: to Key - by DaniceMcHarley - 09.12.2014, 06:46
Re: changing CMD: to Key - by davidstyle1125 - 09.12.2014, 11:37

Forum Jump:


Users browsing this thread: 1 Guest(s)