04.06.2012, 02:05
Just put
in Gamemodeinit for turning the engines and lights manually and on OnPlayerStateChange you cna put the following so it will automatically starts the engine once it checks if you are in a right vehicle id (your car group).
pawn Код:
ManualVehicleEngineAndLights();
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
if( YOUR_CARGROUP_VAR ) // might be a bool or maybe your own global var but replace it with yours.
{
new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
vehicleid = GetPlayerVehicleID( playerid );
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
}
return 1;
}