23.07.2013, 17:13
I have command /lights but lights are working only in dark.
PHP код:
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;
}