Car Lights.
#1

How can change that car lights will show in day light to not only when is dark.
Reply
#2

maybe use a command that turns on and off the lights
Reply
#3

https://www.******.com/url?sa=t&sour...wFwXTwFB367g0g

Put that under OnGameModeInit()
Reply
#4

Quote:
Originally Posted by Krakuski
Посмотреть сообщение
But you need to make a command
Reply
#5

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!
Reply
#6

I have command /lights but lights are working only in dark.

PHP код:
       if(strcmp(cmd"/lights"true) == 0)
    {
        new 
GetPlayerVehicleID(playerid);
        if(
IsPlayerInAnyVehicle(playerid))
           {
               if(
IsPlayerInAnyVehicle(playerid))
               {
                   new 
seat GetPlayerVehicleSeat(playerid);
                   if(
seat != 0)
                   {
                       return 
1;
                }
             }
            if(
LightsOn[v] == 0)
            {
                  new 
enginelightalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(venginelightalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vengineVEHICLE_PARAMS_ONalarmdoorsbonnetbootobjective);
                
LightsOn[v] = 1;
                
//SendClientMessage(playerid, GREY, "You have turned on the lights.");
                
format(stringsizeof(string), "* %s has turned on the lights."PlayerName(playerid));
                 
ProxDetector(30.0playeridstringPURPLEPURPLEPURPLEPURPLEPURPLE);
                return 
1;
            }
            else
            {
                  new 
enginelightalarmdoorsbonnetbootobjective;
                
GetVehicleParamsEx(venginelightalarmdoorsbonnetbootobjective);
                
SetVehicleParamsEx(vengineVEHICLE_PARAMS_OFFalarmdoorsbonnetbootobjective);
                  
LightsOn[v] = 0;
                
//SendClientMessage(playerid, GREY, "You have turned off the lights.");
                
format(stringsizeof(string), "* %s has turned off the lights."PlayerName(playerid));
                  
ProxDetector(30.0playeridstringPURPLEPURPLEPURPLEPURPLEPURPLE);
                return 
1;
              }
        }
        return 
1;
       } 
Reply
#7

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.
Reply
#8

How can i change weather for lights?

Stock row
PHP код:
stock SetVehicleEngine(vehicleidtoggle)
{
    new
        
engine,
        
light,
        
alarm,
        
doors,
        
bonnet,
        
boot,
        
objective;

    
GetVehicleParamsEx(vehicleidenginelightalarmdoorsbonnetbootobjective);
    if (
toggle)
    {
        if (
Gas[vehicleid] <= 0) return 0;
        
SetVehicleParamsEx(vehicleid1lightalarmdoorsbonnetbootobjective);
        
SetVehicleParamsEx(vehicleid11alarmdoorsbonnetbootobjective);
        
LightsOn[vehicleid] = 1;
        
Engine[vehicleid] = 1;
    }
    else
    {
        
SetVehicleParamsEx(vehicleid00alarmdoorsbonnetbootobjective);
        
LightsOn[vehicleid] = 0;
        
Engine[vehicleid] = 0;
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)