Who can help me
#7

didn't you just read what i said man, here is an example code:
PHP код:
new KeyPressed[MAX_PLAYERS];

#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
    
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_ANALOG_RIGHT))
    {
        if(
KeyPressed[playerid] ==0)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_DOWN))
    {
        if(
KeyPressed[playerid] ==1)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_LEFT))
    {
        if(
KeyPressed[playerid] ==2)
        {
            
KeyPressed[playerid]++;
            }
        }
    else if(
PRESSED(KEY_ANALOG_UP))
    {
        if(
KeyPressed[playerid] ==3)
        {
            
KeyPressed[playerid]++;
            }
        }
    return 
1;

this is an example of right down left up in the exact order.
Reply


Messages In This Thread
Who can help me - by hoanduy - 23.12.2017, 14:20
Re: Who can help me - by cuber - 23.12.2017, 14:26
Re: Who can help me - by hoanduy - 23.12.2017, 14:49
Re: Who can help me - by cuber - 23.12.2017, 14:50
Re: Who can help me - by RogueDrifter - 23.12.2017, 15:08
Re: Who can help me - by hoanduy - 23.12.2017, 15:15
Re: Who can help me - by RogueDrifter - 23.12.2017, 15:57
Re: Who can help me - by GTLS - 24.12.2017, 11:06

Forum Jump:


Users browsing this thread: 1 Guest(s)