SA-MP Forums Archive
/lights help - 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 help (/showthread.php?tid=416957)



/lights help - Godzilla8957 - 18.02.2013

hey everyone
i worked on a /lights command and everytime i put the command in the server all the commands stop working.. can someone help me

Код:
    if(strcmp(cmd, "/lights", true) == 0 || strcmp(cmd, "/l", true) == 0) // by LordMan
	{
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You need to be the vehicle driver, to switch the lights on/off.");
    	if(vlights[playerid] == 1)
    	{
    		new vehicleid = GetPlayerVehicleID(playerid);
			new e,l,a,d,b,bo,o;
			GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
			SetVehicleParamsEx(vehicleid,e,0,a,d,b,bo,o);
			vlights[playerid] = 0;
			OnPropUpdate(4,vehicleid);
			new name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string, sizeof(string), "%s turns off the vehicle lights.", name);
			ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		}
		else if(vlights[playerid] == 0)
		{
   			new vehicleid = GetPlayerVehicleID(playerid);
			new e,l,a,d,b,bo,o;
			GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
			SetVehicleParamsEx(vehicleid,e,1,a,d,b,bo,o);
			vlights[playerid] = 1;
			OnPropUpdate(4,vehicleid);
			new name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, name, sizeof(name));
			format(string, sizeof(string), "%s turns on the vehicle lights.", name);
			ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		}
		return 1;
	}



Re: /lights help - Nuke547 - 18.02.2013

Make sure you have this function on your OnGameModeInit():
pawn Код:
ManualVehicleEngineAndLights();



Re: /lights help - Godzilla8957 - 19.02.2013

Quote:
Originally Posted by Nuke547
Посмотреть сообщение
Make sure you have this function on your OnGameModeInit():
pawn Код:
ManualVehicleEngineAndLights();
i put that and my pawno stopped working


Re: /lights help - thefatshizms - 19.02.2013

Quote:
Originally Posted by Nuke547
Посмотреть сообщение
Make sure you have this function on your OnGameModeInit():
pawn Код:
ManualVehicleEngineAndLights();
Don't be silly, it would still work without this.

Could you please show the code for OnPropUpdate please.