Detecting if player click a key.
#1

I want to detect if a player rightclicks and then they get a boost/turbo. i do not know how to check if they rightclick i have tried to look through wiki but did not really understand it.
my code:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == 128)
    {
        new vehid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            if (turbo == 1)
            {
                new Float:Velocity[3];
                GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]);
                if(Velocity[0] < maxspeed  && Velocity[1] < maxspeed && Velocity[0] > -maxspeed && Velocity[1] > -maxspeed)
                {
                    SetVehicleVelocity(vehid, Velocity[0]*speed, Velocity[1]*speed, 0.0);
                }
            }
        }
    }
    return 1;
}
Thank you
Reply


Messages In This Thread
Detecting if player click a key. - by Madsen - 03.07.2011, 19:30
Re: Detecting if player click a key. - by Bakr - 03.07.2011, 19:31
Re: Detecting if player click a key. - by Madsen - 03.07.2011, 19:34
Re: Detecting if player click a key. - by Vince - 03.07.2011, 19:36
Re: Detecting if player click a key. - by Bakr - 03.07.2011, 19:37
Re: Detecting if player click a key. - by MadeMan - 03.07.2011, 19:56
Re: Detecting if player click a key. - by Bakr - 03.07.2011, 20:00
Re: Detecting if player click a key. - by Madsen - 03.07.2011, 21:41

Forum Jump:


Users browsing this thread: 5 Guest(s)