SA-MP Forums Archive
Lights problem - 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: Lights problem (/showthread.php?tid=374724)



Lights problem - Eugene. - 03.09.2012

Well, I have a little problem. My lights are bugged. It works only when is dark outside (night). I don't know what's up but the lights are not working when is day ? I saw on lots of servers that is working when is day outside.

Codes:

Код:
CMD:lights(playerid, param[])
{
 	new string[128], idx;
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
    idx = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;
	if(!lights)
	{
	    GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
	    SetVehicleParamsEx(idx, engine, 1, alarm, doors, bonnet, boot, objective);
	    format(string, sizeof(string), "* %s turns their vehicle's lights on.", RPN(playerid));
		SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
		GameTextForPlayer(playerid, "~g~Lights On", 3500, 3);
	}
	else
	{
	    GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
	    SetVehicleParamsEx(idx, engine, 0, alarm, doors, bonnet, boot, objective);
	    format(string, sizeof(string), "* %s turns their vehicle's lights off.", RPN(playerid));
		SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
		GameTextForPlayer(playerid, "~r~Lights Off", 3500, 3);
	}
	return 1;
}



Re: Lights problem - Steven82 - 03.09.2012

Is there anything else in your script limiting the lights?


Re: Lights problem - Eugene. - 03.09.2012

No. But I noticed that when I am out of the vehicle the lights is turning on.


Re: Lights problem - [BOPE]Seu._.Madruga - 03.09.2012

pawn Код:
CMD:lights(playerid, param[])
{
    new string[128], vid;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
    vid = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(!lights)
    {
        GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vid, engine, true, alarm, doors, bonnet, boot, objective);
        format(string, sizeof(string), "* %s turns their vehicle's lights on.", RPN(playerid));
        SendClientMessage(playerid,COLOR_PURPLE,string);
        GameTextForPlayer(playerid, "~g~Lights On", 3500, 3);
    }
    else
    {
        GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vid, engine, false, alarm, doors, bonnet, boot, objective);
        format(string, sizeof(string), "* %s turns their vehicle's lights off.", RPN(playerid));
        SendClientMessage(playerid,COLOR_PURPLE,string);
        GameTextForPlayer(playerid, "~r~Lights Off", 3500, 3);
    }
    return 1;
}
Se ajudei da reputation


Re: Lights problem - Eugene. - 03.09.2012

Still not working.


Re: Lights problem - ddnbb - 04.09.2012

Hmm, maybe they work normally, just unvisable for you. Like ChatBubble for example, you cant see it but others can. Just guessing here.