/lights help
#1

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

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)