help for SetVehicleParamsEx
#1

no errors, but why its don't work? script:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	new vid = GetPlayerVehicleID(playerid);
	GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
	if(newkeys == KEY_ANALOG_UP)
	{
	    if(lights == 1||VEHICLE_PARAMS_ON||true)
	    {
            SetVehicleParamsEx(vid,engine,0,alarm,doors,bonnet,boot,objective);
		}
		else if(lights == 0||VEHICLE_PARAMS_OFF||false)
		{
		    SetVehicleParamsEx(vid,engine,1,alarm,doors,bonnet,boot,objective);
		}
	}
	
	if(newkeys == KEY_ANALOG_DOWN)
	{
		if(engine == 1||VEHICLE_PARAMS_ON||true)
	    {
            SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
		}
		else if(engine == 0||VEHICLE_PARAMS_OFF||false)
		{
		    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
		}
	}
	
	if(newkeys == KEY_ANALOG_LEFT)
	{
		if(boot == 1||VEHICLE_PARAMS_ON||true)
	    {
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,0,objective);
		}
		else if(boot == 0||VEHICLE_PARAMS_OFF||false)
		{
		    SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,1,objective);
		}
	}
	
	if(newkeys == KEY_ANALOG_RIGHT)
	{
		if(bonnet == 1||VEHICLE_PARAMS_ON||true)
	    {
            SetVehicleParamsEx(vid,engine,lights,alarm,doors,0,boot,objective);
		}
		else if(bonnet == 0||VEHICLE_PARAMS_OFF||false)
		{
		    SetVehicleParamsEx(vid,engine,lights,alarm,doors,1,boot,objective);
		}
	}
	return 1;
}
Reply
#2

What is VEHICLE_PARAMS_ON defined as?

Also
pawn Код:
if(lights == 1||VEHICLE_PARAMS_ON||true)
You are using true at the end of the statement for nothing. It's like saying
pawn Код:
if(1)
{
}
Maybe if you put it like this

pawn Код:
if(lights == 1||VEHICLE_PARAMS_ON == true)
Reply
#3

VEHICLE_PARAMS_ON don't need define its like 1 or true.

I don't know how function get engine or lights. Idon't know what must be here if(engine == ?)
Reply
#4

lol. This makes me confused

pawn Код:
if(engine == 1||VEHICLE_PARAMS_ON||true)
If engine is 1 or VEHICLE_PARAMS_ON or true .... ( It should works ) xD

But try it like this
pawn Код:
if ( engine == 1 || engine == VEHICLE_PARAMS_ON || engine == true )
If engine is 1 or engine is VEHICLE_PARAMS_ON or engine is true. ( No idea ) xD
Reply
#5

Quote:
Originally Posted by Basicz
Посмотреть сообщение
lol. This makes me confused

pawn Код:
if(engine == 1||VEHICLE_PARAMS_ON||true)
If engine is 1 or VEHICLE_PARAMS_ON or true .... ( It should works ) xD

But try it like this
pawn Код:
if ( engine == 1 || engine == VEHICLE_PARAMS_ON || engine == true )
If engine is 1 or engine is VEHICLE_PARAMS_ON or engine is true. ( No idea ) xD
now I have tag mismachs

****** [18:09:57] if = 1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)