Keys problem
#7

Okay, then just make a variable to check if he has already pressed it or not and reset it when it's released. For example:

pawn Код:
new bool:Pressed[MAX_PLAYERS] = false;
pawn Код:
forward UpdateAll();
public UpdateAll()
{
    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(PlayerInfo[i][pSelection] == 1 && Pressed[i] == false)
        {
            new keys,ud,lr;
            GetPlayerKeys(i,keys,ud,lr);
            new rand = random(sizeof(RandomVeh));
            if(lr > 0)
            {
                print("Right");
                Pressed[i] = true;
            }
            else if(lr < 0)
            {
                print("Left");
                Pressed[i] = true;
            }
            else Pressed[i] = false;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Keys problem - by Exxious - 08.01.2011, 15:22
Re: Keys problem - by JaTochNietDan - 08.01.2011, 15:26
Re: Keys problem - by Mr.Stranger - 08.01.2011, 15:27
Re: Keys problem - by HyperZ - 08.01.2011, 15:33
Re: Keys problem - by Joe Staff - 08.01.2011, 15:37
Re: Keys problem - by Exxious - 09.01.2011, 10:21
Re: Keys problem - by JaTochNietDan - 09.01.2011, 13:39

Forum Jump:


Users browsing this thread: 1 Guest(s)