Nitro - please help, newbie here
#5

It's weird, because nitro has an array of MAX_PLAYERS and if any of the online players use /nitro, it calls the function. Try with your timer.

pawn Код:
// OnGameModeInit/OnFilterScriptInit
SetTimer( "Nitro", 1000, true );

CMD:nitro( playerid, params[ ] )
{
    if( nitro[ playerid ] == 0 ) nitro[ playerid ] = 1;
    else nitro[ playerid ] = 0;
    return 1;
}

forward Nitro();
public Nitro()
{
    for( new i = 0; i < MAX_PLAYERS; i ++ )
    {
        new vehicle = GetPlayerVehicleID(i);
        if(nitro[i] == 0) RemoveVehicleComponent(vehicle,1010);
        else
        {
            if(CheckVehicle(vehicleid)) AddVehicleComponent(vehicle, 1010);
        }
    }
    return 1;
}
EDIT: Now, you posted the part of the code, it's clearly. You use SetTimer and you pass the parameters (playerid, vehicleid), you have to use SetTimerEx instead, or with SetTimer and make a for loop.
Reply


Messages In This Thread
Nitro - please help, newbie here - by beasty - 28.12.2012, 11:12
Re: Nitro - please help, newbie here - by Jimmy0wns - 28.12.2012, 11:19
Re: Nitro - please help, newbie here - by Konstantinos - 28.12.2012, 11:20
Re: Nitro - please help, newbie here - by beasty - 28.12.2012, 11:29
Re: Nitro - please help, newbie here - by Konstantinos - 28.12.2012, 11:37
Re: Nitro - please help, newbie here - by beasty - 28.12.2012, 11:48

Forum Jump:


Users browsing this thread: 1 Guest(s)