Unlimited Nitros....Is this possible?
#8

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
It looks cooler when you release the key if it disappears :P. Also for the loop, I really CBF making it efficient because I wrote it up in a short period of time. Feel free to fix it .
Ok fair game lol, never seen that before :P.


Here's how i would do it

pawn Код:
new InvalidNosVehicles[] =
{
    430,446,448,449,452,453,454,461,462,463,468,472,473,481,484,
    493,509,510,520,521,522,523,537,538,569,570,581,586,590,595
};

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & 4)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new
                VehcileID,
                VehicleModelID,
                bool:Invalid;

            VehicleID = GetPlayerVehicleID(playerid);
            VehicleModelID = GetVehicleModel(VehicleID);

            for(new a=0; a<sizeof(InvalidNosVehicles); a++)
            {
                if(VehicleModelID == InvalidNosVehicles[a])
                {
                    Invalid = true;
                    break;
                }
            }
            if(!Invalid) AddVehicleComponent(VehicleID, 1010);
        }
    }
    return 1;
}

Im not at a place where i can compile / test :P, but should be fine. Someone could take it further and convert the array into a switch... but im to lazy :P.
Reply


Messages In This Thread
Unlimited Nitros....Is this possible? - by r3k1lLz_ - 03.09.2010, 11:26
Re: Unlimited Nitros....Is this possible? - by SpaZ (Ed) - 03.09.2010, 11:34
Re: Unlimited Nitros....Is this possible? - by Cank - 03.09.2010, 11:40
Re: Unlimited Nitros....Is this possible? - by Kyosaur - 03.09.2010, 11:46
Re: Unlimited Nitros....Is this possible? - by [HiC]TheKiller - 03.09.2010, 11:56
Re: Unlimited Nitros....Is this possible? - by Kyosaur - 03.09.2010, 12:00
Re: Unlimited Nitros....Is this possible? - by [HiC]TheKiller - 03.09.2010, 12:05
Re: Unlimited Nitros....Is this possible? - by Kyosaur - 03.09.2010, 12:11
Re: Unlimited Nitros....Is this possible? - by dax123 - 03.09.2010, 12:45
Re: Unlimited Nitros....Is this possible? - by Mike Garber - 03.09.2010, 13:00

Forum Jump:


Users browsing this thread: 1 Guest(s)