23.07.2013, 16:05
How can change that car lights will show in day light to not only when is dark.
#include <ZCMD>
//UNDER #include <a_samp>
public OnGameModeInit()
{
ManualVehicleEngineAndLights(); // PUT THIS HERE
return 1;
}
//BOTTOM OF SCRIPT
CMD:engine(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid;
if(vehicleid == 509 || vehicleid == 481 || vehicleid == 510) return SendClientMessage(playerid, -1, "Bicycles have no engine.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You are not driving a vehicle.");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(!engine)
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
else
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
CMD:lights(playerid, param[])
{
new idx;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You are not driving a vehicle.");
idx = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
if(!lights)
{
SetVehicleParamsEx(idx, engine, 1, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "~g~Lights On", 3500, 3);
}
else
{
SetVehicleParamsEx(idx, engine, 0, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "~r~Lights Off", 3500, 3);
}
return 1;
}
if(strcmp(cmd, "/lights", true) == 0)
{
new v = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new seat = GetPlayerVehicleSeat(playerid);
if(seat != 0)
{
return 1;
}
}
if(LightsOn[v] == 0)
{
new engine, light, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(v, engine, light, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(v, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
LightsOn[v] = 1;
//SendClientMessage(playerid, GREY, "You have turned on the lights.");
format(string, sizeof(string), "* %s has turned on the lights.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
return 1;
}
else
{
new engine, light, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(v, engine, light, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(v, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
LightsOn[v] = 0;
//SendClientMessage(playerid, GREY, "You have turned off the lights.");
format(string, sizeof(string), "* %s has turned off the lights.", PlayerName(playerid));
ProxDetector(30.0, playerid, string, PURPLE, PURPLE, PURPLE, PURPLE, PURPLE);
return 1;
}
}
return 1;
}
stock SetVehicleEngine(vehicleid, toggle)
{
new
engine,
light,
alarm,
doors,
bonnet,
boot,
objective;
GetVehicleParamsEx(vehicleid, engine, light, alarm, doors, bonnet, boot, objective);
if (toggle)
{
if (Gas[vehicleid] <= 0) return 0;
SetVehicleParamsEx(vehicleid, 1, light, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
LightsOn[vehicleid] = 1;
Engine[vehicleid] = 1;
}
else
{
SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
LightsOn[vehicleid] = 0;
Engine[vehicleid] = 0;
}
return 1;
}