help with OnPlayerKeyStateChange
#7

Quote:
Originally Posted by radhakr
I made this speedboost yesterday. It works when you press the mouse button in a vehicle:

pawn Код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
    if(!IsPlayerInAnyVehicle(playerid)) return 0;
    new Float:Velocity[3];
        GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
        SetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0]*1.3, Velocity[1]*1.3, Velocity[2]*1.3);
    }
    return 1;
}
I tried changing the key to KEY_JUMP but it didn't work for me either.. maybe it is something about the fact that you are in a vehicle so you can't jump? I'm not sure.
I tried many other keys now and it seems do be that most of the keys are bugged or something (KEY_JUMP = KEY_ANALOG_DOWN....lol?)
Reply


Messages In This Thread
help with OnPlayerKeyStateChange - by KIDUL - 31.10.2009, 10:35
Re: help with OnPlayerKeyStateChange - by Danny_Costelo - 31.10.2009, 10:36
Re: help with OnPlayerKeyStateChange - by KIDUL - 31.10.2009, 10:39
Re: help with OnPlayerKeyStateChange - by Danny_Costelo - 31.10.2009, 10:45
Re: help with OnPlayerKeyStateChange - by KIDUL - 31.10.2009, 10:48
Re: help with OnPlayerKeyStateChange - by radhakr - 31.10.2009, 14:51
Re: help with OnPlayerKeyStateChange - by KIDUL - 31.10.2009, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)