Car Lights. -
FaZeRs - 23.07.2013
How can change that car lights will show in day light to not only when is dark.
Respuesta: Car Lights. -
yancarlos4500 - 23.07.2013
maybe use a command that turns on and off the lights
Re: Car Lights. -
Krakuski - 23.07.2013
https://www.******.com/url?sa=t&sour...wFwXTwFB367g0g
Put that under OnGameModeInit()
Respuesta: Re: Car Lights. -
yancarlos4500 - 23.07.2013
Quote:
Originally Posted by Krakuski
|
But you need to make a command
Re: Car Lights. -
Krakuski - 23.07.2013
pawn Код:
#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;
}
Hope this helps!
Re: Car Lights. -
FaZeRs - 23.07.2013
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;
}
Re: Car Lights. -
Scenario - 23.07.2013
The lights won't come on if the you're at a certain weather ID. I'm not sure which one(s) mess(es) with the lights though.
Re: Car Lights. -
FaZeRs - 23.07.2013
How can i change weather for lights?
Stock row
PHP код:
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;
}