SA-MP Forums Archive
/elmon - not working - 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: /elmon - not working (/showthread.php?tid=415438)



/elmon - not working [HELP!!] - Benjamin_Cylerson - 13.02.2013

Can anyone tell me why this is not working?

Код:
command(elmon, playerid, params[])
{
	if(Player[playerid][Faction] == 1 || Player[playerid][Faction] == 2)
	{
	    new vehicleid = GetPlayerVehicleID(playerid), string[256];
    	if(Flasher[vehicleid] == 0)
	    {
	        if(VehicleFaction[vehicleid] == 1 || VehicleFaction[vehicleid] == 2)
			{
				Flasher[vehicleid] = 1;
				new engine, lights, alarm, doors, bonnet, boot, objective;
				SendClientMessage(playerid, WHITE, "You have turned on the emergency lights in this vehicle.");
				GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
				SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
				format(string, sizeof(string), "* %s turns on the Emergency Lights of the %s. *", MaskOnOff(playerid), GetVehicleName(GetPlayerVehicleID(playerid)));
				CloseMessage(playerid, ACTION, string);
				if(Lights[vehicleid] == 0)
				{
					Lights[vehicleid] = 1;
				}
				else
				{
				    Lights[vehicleid] = 1;
				}
			}
			else return SendClientMessage(playerid, WHITE, "This vehicle doesn't have an emergency light.");
		}
        else return SendClientMessage(playerid, WHITE, "The vehicle's emergency lights are already on.");
	}
	else return SendClientMessage(playerid, WHITE, "You aren't in the correct Faction.");
    return 1;
}



Re: /elmon - not working - denNorske - 13.02.2013

What is not working?

BTW use [code ] and [/ code] around your code to make it look better


Re: /elmon - not working - Benjamin_Cylerson - 13.02.2013

Emergency lights is not working. The lights it not swiching. Can anyone help me?


Re: /elmon - not working - pasha97 - 13.02.2013

First of all, I dont think lights will wark at day time. At least they will work at night or with weather ID 10.

Also, this part of script is useless:
Код:
				if(Lights[vehicleid] == 0)
				{
					Lights[vehicleid] = 1;
				}
				else
				{
				    Lights[vehicleid] = 1;
				}
			}



Re: /elmon - not working - Benjamin_Cylerson - 13.02.2013

It is working fine, but the lights is not switching. That's everything I need.


Re: /elmon - not working - pasha97 - 13.02.2013

Quote:
Originally Posted by Benjamin_Cylerson
Посмотреть сообщение
It is working fine, but the lights is not switching. That's everything I need.
If lights are not showing, why do you say it's working fine?


Re: /elmon - not working - Benjamin_Cylerson - 13.02.2013

Don't know, I just need the lights to be fixed.