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

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
I'd just do it like this
pawn Код:
//Func to check if it's not something like a bike
static invalid_nos_vehicle[] =
{
    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,429,461
};


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        new Vid = GetPlayerVehicleId(playerid);
        new model = GetVehicleModel(playerid);
        new invalid_model;
        for (new i = 0; i < sizeof(invalid_nos_vehicle); i++)
        {
            if(model == invalid_nos_vehicle[i]) invalid_model = 1;
        }
        if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && newkeys & KEY_FIRE)
        {
            if(!invalid_model) AddVehicleComponent(Vid,1010);
        }
        if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && oldkeys & KEY_FIRE)
        {
            if(!invalid_model) RemoveVehicleComponent(Vid,1010);
        }
        return 1;
}
Why add the remove o.O ? Once they press the nos button again, it'll add a new container stopping the current nos. Also every time a player pressed a button you are using 3 functions and looping, you should check their state and keys FIRST, then do that.
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)