Vehicle Lights
#1

Yo,

I simply have a lights error, I have a dialog whenever anyone enters any car (player owned or not) and its gives the players a few options, Engine, Idle, Lights, Boot, Bonnet etc.

When I click 'Lights', The textdraw confirms that the script is working however the vehicle lights do not turn on, I have even tried a lights FS, That FS works but only works as indicators, A for left and D for right etc.

I cannot leave the vehicle lights on, Here's the code:

Код:
switch(VehicleInfo[GetPlayerVehicleID(playerid)][vLights])
					         {
			    	             case 1:
				    	         {
				        	         CarLights(GetPlayerVehicleID(playerid),2);
				        	         GameTextForPlayer(playerid, "~w~Lights~n~~r~Off", 4000, 3);
				    	         }
				   	             case 2:
				   	             {
				        	         CarLights(GetPlayerVehicleID(playerid),1);
				        	         GameTextForPlayer(playerid, "~w~Lights~n~~g~On", 4000, 3);
				    	         }
Reply
#2

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
or show the stock of CarLights
Reply
#3

Код:
stock CarLights(idcar,type)
{
    new engine,lights,alarm,doors,bonnet,boot,objective,tmphour,tmpminute,tmpsecond;
    GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
	switch(type)
	{
		case 1:
		{
            gettime(tmphour, tmpminute, tmpsecond);
	        FixHour(tmphour);
        	tmphour = shifthour;
        	switch(tmphour)
        	{
				case 0 .. 5, 21 .. 30: SetVehicleParamsEx(idcar,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
				default: SetVehicleParamsEx(idcar,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
        	}
			VehicleInfo[idcar][vLights] = 1;
		}
		case 2:
		{
			SetVehicleParamsEx(idcar,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
			VehicleInfo[idcar][vLights] = 2;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)