SA-MP Forums Archive
car lights - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: car lights (/showthread.php?tid=426892)



car lights - DerickClark - 30.03.2013

everytime i get in a car the light come on.


i think i delete it,gave me errors i try to fixing.
Код:
1159) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Код:
// This callback gets called whenever a player enters a vehicle
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	// Setup local variables
	new engine,  alarm, doors, bonnet, boot, objective;

	// Check if the vehicle has fuel
	if (AVehicleData[vehicleid][Fuel] > 0)
	{
		// Start the engine and turn on the lights
		GetVehicleParamsEx(vehicleid, engine, alarm, doors, bonnet, boot, objective);
		SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
	}

	// Store the player's current location and interior-id, otherwise anti-airbreak hack code could kick you
	GetPlayerPos(playerid, APlayerData[playerid][PreviousX], APlayerData[playerid][PreviousY], APlayerData[playerid][PreviousZ]);
	APlayerData[playerid][PreviousInt] = GetPlayerInterior(playerid);

	return 1;
}



Re: car lights - BrandyPenguin - 30.03.2013

It should be
pawn Код:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);



Re: car lights - DerickClark - 30.03.2013

i wanna delete the lights one
if a player go in a car,the lights come on.


Re: car lights - MrTinder - 30.03.2013

put this on OnPlayerEnterVehicle
pawn Код:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 0, alarm, doors, bonnet, boot, objective);
Edit:
oh make this
pawn Код:
new engine,  alarm, doors, bonnet, boot, objective;
to this
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;



Re: car lights - DerickClark - 30.03.2013

Thanks,but if it dark it don't turn the lights on.


Re: car lights - MrTinder - 30.03.2013

then you can use command like /lon
pawn Код:
COMMAND:lon(playerid, params[])
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
return 1;
}



Re: car lights - DerickClark - 30.03.2013

not a command like it dark it auto turn on.


Re: car lights - Peach - 30.03.2013

Create a timer that gets the server time, make a variable for the time you want them to turn on set the variable to true and then to false during the times you want the lights off. If the variable is true for when a player gets in a vehicle, set the lights to turn on.