//----------------------------------Неоновая система покупки в гараже--------------------------//

#include <a_samp>
#if defined FILTERSCRIPT
#else
#pragma tabsize 0
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF99AADD
#endif

new checkneon[MAX_PLAYERS];
//---------------------------------------------------------------------------------//

public OnGameModeInit()
{
Create3DTextLabel( "Пропешите /неон в гараже, чтобы выбрать неон!",0x00FF00FF, 1985.7045, -2064.7861, 13.1958, 40.0, 0 , 0 );
CreateObject(8954, 2001.13, -2068.69, 14.12,   0.00, 0.00, 269.85);
CreateObject(11326, 1990.06, -2079.10, 14.66,   0.00, 0.00, 90.00);
}
//---------------------------------------------------------------------------------//
public OnGameModeExit()
{
	return 1;
}

//--------------------------------------------------------------------------------//
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/найтинеон",true) == 0)
		{
		SetPlayerCheckpoint(playerid, 1985.7045, -2064.7861, 13.1958,6.0);
		checkneon[playerid] = 1;
		SendClientMessage(playerid, COLOR_YELLOW, "Место установки неона указано на карте.");
		return 1;
	}
		if (strcmp(cmdtext, "/неон", true)==0)
	{
	 if(IsPlayerInRangeOfPoint(playerid, 7.0, 1985.7045, -2064.7861, 13.1958))
    {

    ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Неон", "{007DD0}Синий,5000$\n{E42600}Красный,5000$\n{78FF00}Зеленый,5000$\nБелый,5000$\n{D33052}Розовый,5000$\n{FFFF00}Желтый,5000$\nМигалку на крышу,5000$\nМигалку на капот,5000$\nНеон сзади,5000$\nНеон спереди,5000$\nМигалку в кабину,5000$\nМигалку на багажник,5000$\nУдалить весь неон,10000$", "Ok", "Назад");
    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
}
return 1;
}
	return 0;
}

//---------------------------------------------------------------------------------//
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);// Если мы хотим, чтобы чекпоинт после этого исчез, то вставляем эту функцию.
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

 if(dialogid == 8899)
	{
		if(response)
		{
			if(listitem == 0)
			{


			//Синий
			GivePlayerMoney(playerid, - 5000);//снимаем бабосы
			SetPVarInt(playerid, "Status", 1);
            SetPVarInt(playerid, "neon", CreateObject(18648,0,0,0,0,0,0));
            SetPVarInt(playerid, "neon1", CreateObject(18648,0,0,0,0,0,0));
            AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили {007DD0}синий неон.");
            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

			}
			if(listitem == 1)
			{


			 //Красный
			 	GivePlayerMoney(playerid,-5000);//снимаем бабосы
				SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon2", CreateObject(18647,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon3", CreateObject(18647,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили {E42600}красный неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

			}
			if(listitem == 2)
			{


			//Зеленый
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
		   	   	SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon4", CreateObject(18649,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon5", CreateObject(18649,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили {78FF00}зеленый неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

	            }
			if(listitem == 3)
			{

			//Белый
			    GivePlayerMoney(playerid,-5000);//снимаем бабосы
		   	   	SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon6", CreateObject(18652,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon7", CreateObject(18652,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили белый неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

}
			if(listitem == 4)
			{


			//Розовый
			    GivePlayerMoney(playerid,-5000);//снимаем бабосы
		   	   	SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon8", CreateObject(18651,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon9", CreateObject(18651,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили {D33052}розовый неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

}
			if(listitem == 5)
			{


			//Желтый
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
		 		SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "neon10", CreateObject(18650,0,0,0,0,0,0));
	            SetPVarInt(playerid, "neon11", CreateObject(18650,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили {FFFF00}жёлтый неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");

}
			if(listitem == 6)
			{
			    GivePlayerMoney(playerid,-5000);//снимаем бабосы
				SetPVarInt(playerid, "Status", 1);
     			SetPVarInt(playerid, "krisha",  CreateObject(18646,0,0,0,0,0,0));
     			SetPVarInt(playerid, "krisha1", CreateObject(18646,0,0,0,0,0,0));
      			AttachObjectToVehicle(GetPVarInt(playerid, "krisha"), GetPlayerVehicleID(playerid), -0.0, -0.2, 0.75, 1.0, 1.0, 1.0);
      			AttachObjectToVehicle(GetPVarInt(playerid, "krisha1"), GetPlayerVehicleID(playerid),  0.0, -0.2, 0.75, 1.0, 1.0, 1.0);
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили мигалку на крышу.");
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
			}
	           	if(listitem == 7)
            {
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
             	SetPVarInt(playerid, "Status", 1);
     			SetPVarInt(playerid, "kapot", CreateObject(18646,0,0,0,0,0,0));
     			SetPVarInt(playerid, "kapot1", CreateObject(18646,0,0,0,0,0,0));
      			AttachObjectToVehicle(GetPVarInt(playerid, "kapot"), GetPlayerVehicleID(playerid), -0.4, 2.2, 0.1, 1.0, 1.0, 1.0);
      			AttachObjectToVehicle(GetPVarInt(playerid, "kapot1"), GetPlayerVehicleID(playerid),  0.4, 2.2, 0.1, 1.0, 1.0, 1.0);
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили мигалки на капот.$");
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
			}
          	if(listitem == 8)
			{

				//Зади
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "back", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "back1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "back"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "back1"), GetPlayerVehicleID(playerid), -0.0, -1.5, -1, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили задний неон.$");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
	            }
            	if(listitem == 9)
				{

				//Спереди
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
	            SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "front", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "front1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "front"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "front1"), GetPlayerVehicleID(playerid), -0.0, 1.5, -0.6, 2.0, 2.0, 3.0);
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили передний неон.");
	            SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
	            }
	            if(listitem == 10)
            {
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
 				SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "kabina", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "kabina1", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "kabina"), GetPlayerVehicleID(playerid), 0.0, 0.9, 0.3, 1.0, 1.0, 1.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "kabina"), GetPlayerVehicleID(playerid), 0.0, 0.9, 0.3, 1.0, 1.0, 1.0);
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили мигалку в кабину.");
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
			}
				if(listitem == 11)
            {
				GivePlayerMoney(playerid,-5000);//снимаем бабосы
				SetPVarInt(playerid, "Status", 1);
	            SetPVarInt(playerid, "baga", CreateObject(18646,0,0,0,0,0,0));
	            SetPVarInt(playerid, "baga", CreateObject(18646,0,0,0,0,0,0));
	            AttachObjectToVehicle(GetPVarInt(playerid, "baga"), GetPlayerVehicleID(playerid), -0.8, -1.8, 0.3, 1.0, 1.0, 1.0);
	            AttachObjectToVehicle(GetPVarInt(playerid, "baga1"), GetPlayerVehicleID(playerid), 0.8, -1.8, 0.3, 1.0, 1.0, 1.0);
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы установили мигалку на багажник.");
      			SendClientMessage(playerid, 0xFFFFFFAA, "Вы заплатили 5000$");
			}
			if(listitem == 12)
			{
			//Удаление неона
			GivePlayerMoney(playerid,-10000);//снимаем бабосы
            DestroyObject(GetPVarInt(playerid, "neon"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon2"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon3"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon4"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon5"));
			DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon6"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon7"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon8"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon9"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon10"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "neon11"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "kabina"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "kabina"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "Kapot"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "kapot1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back1"));
            DeletePVar(playerid, "Status");
			DestroyObject(GetPVarInt(playerid, "front"));
			DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "front1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "krisha"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "krisha1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "baga"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "baga1"));

            DeletePVar(playerid, "Status");


	 	      }
		 }
		 }
		 	return 1;
		}
