pawn Код:
//top of script
new Engine[MAX_VEHICLES], Lights[MAX_VEHICLES];
//put this under ongamemodeinit
ManualVehicleEngineAndLights();
public OnVehicleSpawn(vehicleid)
{
Engine[vehicleid] = 0;
Lights[vehicleid] = 0;
return 1;
}
CMD:engine(playerid, params[])
{
if(GetPlayerState(playerid) == 2)
{
new vehicle = GetPlayerVehicleID(playerid);
if(Engine[vehicle] == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Engine[vehicle] = 1;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Engine[vehicle] = 0;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
}
}
else return SendClientMessage(playerid, COLOR_GRAY, "/Engine to Start & Stop Vehicle Engine!");
return 1;
}
CMD:lights(playerid, params[])
{
if(GetPlayerState(playerid) == 2)
{
new vehicle = GetPlayerVehicleID(playerid);
if(Lights[vehicle] == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Lights[vehicle] = 1;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, engine, 1, alarm, doors, bonnet, boot, 0);
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective;
Lights[vehicle] = 0;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicle, engine, 0, alarm, doors, bonnet, boot, 0);
}
}
else return SendClientMessage(playerid, COLOR_GRAY, "/lights to Turn on & off Vehicle Light!");
return 1;
}