Quote:
Originally Posted by Dwane
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.
|
Working perfect, thanks you very much.