Lights command
#7

Vehicles are on by default. As long as you aren't using SetVehicleParamsEx under OnPlayerStateChange or OnPlayerEnterVehicle, you shouldn't have a problem with the engine being disabled.

pawn Код:
CMD:lights(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "Error: You are not in the drivers seat of any vehicle.");
    new vehicleid = GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, engine, (lights) ? (0) : (1), alarm, doors, bonnet, boot, objective);
    return 1;
}
Reply


Messages In This Thread
Lights command - by Timeless - 06.07.2014, 21:14
Re: Lights command - by Vanter - 06.07.2014, 23:31
Re: Lights command - by nmader - 06.07.2014, 23:32
Re: Lights command - by Timeless - 07.07.2014, 00:05
Re: Lights command - by Vanter - 07.07.2014, 00:16
Re: Lights command - by Timeless - 07.07.2014, 00:27
Re: Lights command - by Threshold - 07.07.2014, 00:47
Re: Lights command - by Timeless - 07.07.2014, 00:58
Re: Lights command - by Timeless - 07.07.2014, 01:03
Re: Lights command - by Threshold - 07.07.2014, 01:11

Forum Jump:


Users browsing this thread: 1 Guest(s)