car lights
#1

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;
}
Reply
#2

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

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

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;
Reply
#5

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

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;
}
Reply
#7

not a command like it dark it auto turn on.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)