I think you need to use a variable. Like:
pawn Code:
new
vEngine[ MAX_VEHICLES ]
;
public OnGameModeInit( )
{
ManualVehicleEngineAndLights( );
return 1;
}
public OnVehicleSpawn( vehicleid )
{
vEngine[ vehicleid ] = 0;
return 1;
}
COMMAND:engine( playerid, params[ ] )
{
if ( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "You are not in any vehicle." );
new vid = GetPlayerVehicleID( playerid ), engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
switch( vEngine[ vid ] )
{
case 0: vEngine[ vid ] = 1, SetVehicleParamsEx( vid, 1, lights, alarm, doors, bonnet, boot, objective ), SendClientMessage( playerid, -1, "turned on" );
default: vEngine[ vid ] = 0, SetVehicleParamsEx( vid, 0, lights, alarm, doors, bonnet, boot, objective ),
SendClientMessage( playerid, -1, "turned off" );
}
return 1;
}
Hope it helps.