#1

hello guys , well im trying somthing and i cant do it ! i wanna use the car nos with one click ! i mean the nos stay off when i click the nos is on when i stop clickin the nos off ! got it ?!

if u understand what i mean and can do it it ! plz send it all here , tnx
Reply
#2

Haven't tested it but it should work:

pawn Код:
//On top of your script.
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
   
#define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
//OnPlayerKeyStateChange
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerVehicleSeat(playerid) == 0)// If the player is a driver
        {
            new vehicle = GetPlayerVehicleID(playerid);

            if(PRESSED(KEY_FIRE))
            {
                AddVehicleComponent(vehicle, 1010); // Adds Nitro.
            }
            else if(RELEASED(KEY_FIRE))
            {
                RemoveVehicleComponent(vehicle,1010); // Removes Nitro.
            }
        }
    }
    return 1;
}
Reply
#3

tnx bro . this works great
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)