/lights
#1

So, basically the lights don't work, they won't turn on in game.

Код:
CMD:lights(playerid, param[])
{
	new string[128], idx;
	if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use 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;
	GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
	if(!lights)
	{
	    SetVehicleParamsEx(idx, engine, 2, 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
	{
	    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;
}
Reply


Messages In This Thread
/lights - by YoDawg - 12.12.2015, 11:00
Re: /lights - by jlalt - 12.12.2015, 11:07
Re: /lights - by YoDawg - 12.12.2015, 11:12
Re: /lights - by jlalt - 12.12.2015, 11:18
Re: /lights - by YoDawg - 12.12.2015, 11:19
Re: /lights - by Sinox - 12.12.2015, 11:25
Re: /lights - by YoDawg - 12.12.2015, 11:32

Forum Jump:


Users browsing this thread: 1 Guest(s)