vehilce nitro
#1

how to make that when you press left mouse key you get nitro

I will ad the funtion to the gamemode
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        new veh = GetPlayerVehicleID(playerid);
        AddVehicleComponent(veh,1010);
        return 1;
    }
    return 1;
}
Reply
#3

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

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            new gpvi = GetPlayerVehicleID(playerid);
            RemoveVehicleComponent(gpvi, 1010);
            AddVehicleComponent(gpvi, 1010);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)