19.04.2013, 12:50
Hello guys.
I'm Benjamin Jones and I need some help.So I will discribe my problem.When I type /lights I they are working if the time is dark(Night).If it's day they doesn't work.If someone can help me will be really good.I just want to someone make it to work when is day and when is night ... 24 hours...Thank you.
If you help me, I will give you +1 Rep
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;
}
I'm Benjamin Jones and I need some help.So I will discribe my problem.When I type /lights I they are working if the time is dark(Night).If it's day they doesn't work.If someone can help me will be really good.I just want to someone make it to work when is day and when is night ... 24 hours...Thank you.
If you help me, I will give you +1 Rep
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;
}

