Daytime Car Lights
#1

Hello guys, can you turn on the daytime car lights? I need the code, very thx friends...


I have this code but only turn on the lights at night:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{

if(newkeys == KEY_SUBMISSION)
{
if(IsPlayerInAnyVehicle(playerid))
		{
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
                                new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
				vehicleid = GetPlayerVehicleID(playerid);
				GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

				if(lights)
    {
             SetVehicleParamsEx(vehicleid, engine, false, alarm, doors, bonnet, boot, objective);
    }
    else
    {
     				SetVehicleParamsEx(vehicleid, engine, true, alarm, doors, bonnet, boot, objective);
    }
			}
			}
		return 1;
}
Reply
#2

PHP код:
ManualVehicleEngineAndLights(); 
under
PHP код:
public OnGameModeInit() 
Reply
#3

Now, car dont move
Reply
#4

You need to define VehicleParams

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Reply
#5

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Now, car dont move
That's because the engine is off.

Add this:

PHP код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
    return 
1;
}
public 
OnPlayerExitVehicle(playerid,vehicleid)
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(vehicleid,0,0,alarm,doors,bonnet,boot,objective);
    return 
1;

Reply
#6

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
That's because the engine is off.

Add this:

PHP код:
public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
    return 
1;
}
public 
OnPlayerExitVehicle(playerid,vehicleid)
{
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(vehicleid,0,0,alarm,doors,bonnet,boot,objective);
    return 
1;

Very thx friend, one question for on engine of trolley car??...
Reply
#7

bump
Reply
#8

Quote:
Originally Posted by bookknp
Посмотреть сообщение
bump
Can u repeat your question? i don't understand what u want to do.
Reply
#9

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Very thx friend, one question for on engine of trolley car??...
Trailer? Nah.... Train? SF Tram?


Maybe the tram?
Reply
#10

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Can u repeat your question? i don't understand what u want to do.
hello guys, I want to turn on the San Fierro Tram engine, but now ManualVehicleEngineAndLights () is set; and does not allow to move, can someone help me?? thx friends
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)