#include <a_samp>
#include <sscanf2>
#include <mysql>

COMMAND:mysqlid(playerid, params[])
{
	new string[50];
	format(string,sizeof(string),"Your id: %d",PlayerInfo[playerid][pID]);
	SendClientMessage(playerid,-1,string);
	return true;
}

COMMAND:backpack(playerid, params[])
{
	if(PlayerInfo[playerid][pPack])
	{
		if(!ShowPlayerDialogEx(playerid,188,2,"Рюкзак","{33CCFF}Положить\n{9ACD32}Достать\n{AFAFAF}Инфо","Выбор","Назад"))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		}
	}
	else SendClientMessage(playerid,COLOR_GREY,"У вас нет рюкзака, купите его в 24/7");
	return true;
}

COMMAND:tp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new tpid;
	    if(sscanf(params,"d",tpid)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /tp [id]");
	    switch(tpid)
	    {
	        case 0:
	        {
	            SetPlayerInterior(playerid,10);
				J_SetPlayerPos(playerid,370,-72.300003051758,1001.5);
	        }
	        case 1:
	        {
	            SetPlayerInterior(playerid,9);
				J_SetPlayerPos(playerid,370.10000610352,-7.4000000953674,1001.9000244141);
	        }
	    }
	}
	return true;
}

COMMAND:cardoors(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new string[100];
		sscanf(params, "i", DoorsLockSystemON);
		format(string, sizeof(string), "Вы установили статус системы на {33AA33}%i", DoorsLockSystemON);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
	return true;
}

COMMAND:gotofuel(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new fuelid;
	    if(sscanf(params,"d",fuelid)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /gotofuel [id]");
	    J_SetPlayerPos(playerid,FuelInfo[fuelid][fPos_X],FuelInfo[fuelid][fPos_Y],FuelInfo[fuelid][fPos_Z]);
		SetPlayerInterior(playerid,0);
	}
	return true;
}

COMMAND:hostital(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    SetPlayerInterior(playerid,1);
	    SetPlayerVirtualWorld(playerid,2);
		J_SetPlayerPos(playerid,1169.3988,-1322.8319,-0.8598);
 	}
 	return true;
}
COMMAND:stopmp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(Now_MP != -1)
	    {
	        Mp_Stopped();
	    }
	}
	return true;
}

COMMAND:armour(playerid, params[])
{
	if(PlayerInfo[playerid][pArmours])
	{
        PlayerInfo[playerid][pArmours] --;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы надели бронежилет");
        J_SetPlayerArmour(playerid,100);
	}
	else SendClientMessage(playerid, COLOR_GREY, "У вас нет бронежилета");
	return true;
}

COMMAND:house(playerid, params[])
{
	new house = PlayerInfo[playerid][pHouseKey];
	if(house != -1)
	{
	    if(!ShowPlayerDialogEx(playerid,174,2,"Дом","\
		1. Открыть/Закрыть\n\
		2. Шкаф\n\
		3. Улучшить дом\n\
		4. Установить аренду\n\
		5. Предложить аренду\n\
		6. Выселить игрока\n\
		7. Список арендаторов\n\
		8. Отказаться от аренды\n\
		9. Продать дом\n\
		10. Продать дом игроку","Выбор","Отмена"))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы не живете ни в 1 из домов");
	return true;
}

COMMAND:mp(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,money;
	    if(sscanf(params,"dd",id,money)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /mp [mp id] [приз]");
	    if(Now_MP == -1) CreateMP(id,money);
		else return SendClientMessage(playerid,COLOR_GREY,"МП уже идёт");
	}
	return true;
}

COMMAND:amp(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,money,time,string[150];
	    if(sscanf(params,"ddd",id,money,time)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /amp [mp id] [приз] [время (в сек.)]");
	    if(Now_MP == -1)
		{
			CreateMP(id,money);
			MP_StartTimer = SetTimer("MpStarted",time*1000,0);
			format(string,sizeof(string),"МП стартует через %d секунд (пишите /gomp для участия в нем)",time);
			SendClientMessageToAll(COLOR_GREEN,string);
		}
		else return SendClientMessage(playerid,COLOR_GREY,"МП уже идёт");
	}
	return true;
}

COMMAND:startmp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		return MpStarted();
	}
	return true;
}
COMMAND:exitmp(playerid, params[])
{
	if(InMP[playerid])
	{
	    InMP[playerid] = false;
	    CheckMP(playerid, GetPlayerVehicleID(playerid));
	    PlayerSpawn(playerid);
	}
	return true;
}

COMMAND:gomp(playerid, params[])
{
	new string[150];
	if(Now_MP != -1 && !Start_MP && !InMP[playerid])
	{
		switch(Now_MP)
		{
			case 0:
			{
			    InMP[playerid] = true;
			    for(new i = 0; i < 32; i ++)
			    {
			        new vehid = MP_Car[i];
			        if(GetVehicleSeat(vehid, 0) == INVALID_PLAYER_ID)
			        {
						new Float:X, Float:Y, Float:Z;
						GetVehicleShiftPos(vehid, 0, X, Y, Z, 3.0);
						J_SetPlayerHealth(playerid, 100);
						SetPlayerInterior(playerid, 15);
						SetPlayerVirtualWorld(playerid, 0);
						J_SetPlayerPos(playerid, X, Y, Z);
						break;
			        }
			    }
			}
			case 1:
			{
				InMP[playerid] = true;
			    for(new i = 0; i < 36; i ++)
			    {
			        new vehid = MP_Car[i];
			        if(GetVehicleSeat(vehid, 0) == INVALID_PLAYER_ID)
			        {
						new Float:X, Float:Y, Float:Z;
						GetVehicleShiftPos(vehid, 0, X, Y, Z, 3.0);
						J_SetPlayerHealth(playerid, 100);
						SetPlayerInterior(playerid, 0);
						SetPlayerVirtualWorld(playerid, 0);
						J_SetPlayerPos(playerid, X, Y, Z);
						break;
			        }
			    }
			}
			case 2:
			{
				if(!InMP[playerid])
				{
					J_SetPlayerHealth(playerid, 100);
					InMP[playerid] = true;
					SetPlayerTeam(playerid, MP_TEAM);
					SetPlayerInterior(playerid, 0);
					SetPlayerVirtualWorld(playerid, 0);
					TextDrawShowForPlayer(playerid, TDM_DRAW);
					MP_COUNT_PLAYERS[MP_TEAM] ++;
					format(string,sizeof(string),"~y~›EћTЁE: %d~n~~r~KPACHЁE: %d",MP_COUNT_PLAYERS[1],MP_COUNT_PLAYERS[2]);
					TextDrawSetString(TDM_DRAW,string);
					if(MP_TEAM == 1)
					{
						J_SetPlayerColor(playerid, COLOR_YELLOW);
						SetPlayerColor(playerid, COLOR_YELLOW);
						SetPlayerSkin(playerid, 51);
						SendClientMessage(playerid,COLOR_GREY,"Ждите начала командного ДМ...");
						SendClientMessage(playerid,COLOR_GREY,"Не убивайте своих товарещей");
						J_SetPlayerPos(playerid,-1391.0898,1494.1565,1.8735);
						MP_TEAM = 2;
					}
					else if(MP_TEAM == 2)
					{
						J_SetPlayerColor(playerid, COLOR_LIGHTRED);
						SetPlayerColor(playerid, COLOR_LIGHTRED);
						SetPlayerSkin(playerid, 52);
						SendClientMessage(playerid,COLOR_GREY,"Ждите начала командного ДМ...");
						SendClientMessage(playerid,COLOR_GREY,"Не убивайте своих товарещей");
						J_SetPlayerPos(playerid,-1469.5667,1489.3951,8.2501);
						MP_TEAM = 1;
					}
				}
			}
		}
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы были телепортированы на МП");
		SendClientMessage(playerid,COLOR_WHITE,"Чтобы выйти с МП введите {33CCFF}/exitmp");
		return true;
	}
	return true;
}

COMMAND:astartmp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new time, string[150];
        if(sscanf(params,"d",time)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /astartmp [время в секундах]");
		MP_StartTimer = SetTimer("MpStarted",time*1000,false);
		format(string, sizeof(string),"МП стартует через %d секунд (пишите /gomp для участия в нем)", time);
		SendClientMessageToAll(COLOR_GREEN, string);
	}
	return true;
}

COMMAND:unmask(playerid, params[])
{
	if(UnMaskReset[playerid] > 0) return true;
	UnMaskReset[playerid] = 3;
	for(new i; i < GetMaxPlayersEx(); i ++)
	{
 		if(CuffedTime[i] > 0 || Cuffed[i])
 		{
			if(PlayerInfo[i][pMaskON])
			{
 				if(ProxDetectorS(2.0, playerid, i) && GetPlayerFaceToPlayer(playerid, i, 30.0))
				{
					new string[100];
					PlayerInfo[i][pMaskON] = false;
					format(string,sizeof(string),"Вы сняли маску с игрока %s",PN(i));
					SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
					format(string,sizeof(string),"%s снял с вас маску",cPN(playerid));
					SendClientMessage(i,COLOR_GREY,string);
					format(string,sizeof(string),"%s снял маску с игрока %s",cPN(playerid), PN(i));
					ProxDetector(10.0, playerid, string, COLOR_PURPLE);
					UpdateHPBar(i);
					break;
			    }
		    }
	    }
    }
    return true;
}

COMMAND:blacklist(playerid, params[])
{
	if(IsAMer(playerid) || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id, reason[100];
	    if(sscanf(params,"us[100]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /blacklist [id] [причина]");
	    if(IsPlayerConnected(id))
	    {
	        if(IsAtFrakcia(id))
	        {
		        if(!PlayerInfo[id][pBL])
		        {
		            new string[100];
		            PlayerInfo[id][pBL] = 1;
		            PlayerInfo[id][pMember] = 0;
		            PlayerInfo[id][pLeader] = 0;
		            PlayerInfo[id][pRank] = 0;
		            PlayerInfo[id][pZKP] = 0;
		            SetBumSkin(id);
					SaveAccount(id);
					PlayerSpawn(id);
		            format(string,sizeof(string),"Вы занесли игрока %s(%i) в чёрный список закона. Причина: %s", PN(id), id, reason);
		            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		            format(string,sizeof(string),"%s занёс вас в чёрный список закона. Причина: %s", PN(playerid), reason);
		            SendClientMessage(id,COLOR_GREY,string);
		            SendClientMessage(id,COLOR_GREY,"Чтобы выйти из него необходимо набрать 50 очков законопослушности");
		        }
	        }
	    }
    }
    return true;
}

COMMAND:unblacklist(playerid, params[])
{
	if(IsAMer(playerid) || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /unblacklist [id]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pBL])
		    {
		        new string[100];
		        PlayerInfo[id][pBL] = 0;
				SaveAccount(id);
		        format(string,sizeof(string),"Вы удалили игрока %s(%i) чёрного списка закона",PN(id),id);
		        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		        format(string,sizeof(string),"%s удалил вас из чёрного списка закона",PN(playerid));
		        SendClientMessage(id,COLOR_GREY,string);
	        }
	    }
    }
    return true;
}

COMMAND:lights(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new carid = GetPlayerVehicleID(playerid);
	    if(!IsAVelik(carid) && !IsAPlane(carid))
	    {
	        if(GetEngineStatus(carid))
	        {
			    SetLightsStatus(carid, !GetLightsStatus(carid));
				new max_seats = GetVehicleMaxSeat(carid);
				for(new i; i < max_seats; i ++)
				{
				    new player = GetVehicleSeat(carid, i);
				    if(player == INVALID_PLAYER_ID) continue;
				    for(new t = 0; t < 12; t ++)
					{
					 	ToggleTextDrawForPlayer(player, SpeedDraw[t + 13], GetLightsStatus(carid));
					 	ToggleTextDrawForPlayer(player, SpeedDraw[t], !GetLightsStatus(carid));
					}
				}
			}
	    }
	}
	return true;
}

COMMAND:hidedraws(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    for(new i; i < 2000; i ++)
	    {
	        TextDrawHideForPlayer(playerid, Text:i);
	        PlayerTextDrawHide(playerid, PlayerText:i);
	    }
    }
	return true;
}

COMMAND:robbank(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] != JOB_COLLECTOR)
	{
	    if(!IsANotControllable(playerid))
	    {
		    if(IsPlayerInRangeOfPoint(playerid,1.5,1458.3990478516,-967.38012695313,-76.269996643066))
			{
			    if(GetPlayerVirtualWorld(playerid) == 1)
			    {
				    if(SafeRobID == INVALID_PLAYER_ID)
				    {
						if(IsAtMafia(playerid))
					    {
					    	if(SafeMoney > 0)
	        				{
	        				    new rob1 = GetRobCPPlayer(0), rob2 = GetRobCPPlayer(1);
	        				    if(rob1 != -1 && rob2 != -1 && rob2 != playerid && rob1 != playerid && GetTeamID(rob1) == GetTeamID(playerid))
	        				    {
		        				    new cops;
		            				if(!GetCopsIsRangeOfPoint(cops, 20.0, 1458.3990478516,-967.38012695313,-76.269996643066))
				    				{
				    				    if(cops >= 5)
				    				    {
							                CheckRobBank(playerid);
									        CheckTheftCar(playerid);
									        CheckMiner(playerid);
									        CheckRobPlayer(playerid);
									        CheckBreakCuff(playerid);
							                SafeRobID = playerid;
							                BankClosed = true;
							                DestroyPickup(ExitBankPickup);
										    ExitBankPickup = CreatePickup(19130, 1, 1470.8192, -977.3422, -79.2749, 1);
											UpdateDynamic3DTextLabelText(ExitBankText, COLOR_GREY, "Банк закрыт. Выход из него невозможен!");
											DestroyPickup(EnterBankPickup);
										    EnterBankPickup = CreatePickup(19130, 1, 1467.282836, -1010.363403, 26.843750, 10);
										    UpdateDynamic3DTextLabelText(EnterBankText, COLOR_WHITE, "Банк Los Santos {FF0000}[Закрыт]");
							                SendClientMessage(playerid, COLOR_WHITE, "Вы начали грабить банк. Вход в банк закрыт.");
							                J_TogglePlayerControllable(playerid, false);
							                ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob",4.1, 0, 1, 1, 1, 0, 1);
							                SetPlayerRandomKey(playerid, RobKey[playerid], true);
							                ShowPlayerActionBand(playerid, 0, 10);
							                for(new i; i < GetMaxPlayersEx(); i ++)
							                {
							                    if(ProxDetectorS(20.0, playerid, i) || i == playerid)
							                    {
							                        if(GetPlayerVirtualWorld(i) == 1)
							                        {
							                			PlayerPlaySound(i, 41800, 0, 0, 0);
							                		}
							                	}
							                }
							                SetPlayerWantedLevel(playerid,10);
											PlayerInfo[playerid][pWanted] = 10;
											CreatePlayerFindZone(playerid);
							                SendClientMessage(playerid, COLOR_RED, "Вас засекли камеры наблюдения! У вас есть немного времени чтобы уйти отсюда!");
							                SendCopsMessage(COLOR_BLUE, "Внимание! Было замечено ограбление банка! Всем постам направляться к банку Los Santos'a!");
						                }
						                else SendClientMessage(playerid,COLOR_GREY,"Для ограбления банка на сервере должно быть не менее 5-и копов");
						            }
						            else SendClientMessage(playerid,COLOR_GREY,"Рядом с вами не должно быть копов");
					            }
					            else SendClientMessage(playerid,COLOR_GREY,"2 члена вашей мафии должны занять свои позиции");
					        }
					        else SendClientMessage(playerid,COLOR_GREY,"В сейфе нет денег");
					    }
					    else SendClientMessage(playerid,COLOR_GREY,"Банк могут грабить только члены мафий");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Банк уже грабят");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Вы не возле сейфа");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Вы не возле сейфа");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы не можете двигаться");
	}
	else SendClientMessage(playerid,COLOR_GREY,"Инкассаторы не могут грабить банк");
	return true;
}

COMMAND:cars(playerid, params[])
{
	new string[600],str[50],cars;
	for(new i = 0;i < OWNABLECARS;i ++)
	{
		new number = OwnableCar[i];
		if(IsPlayerHaveCar(playerid,number))
		{
		    ShowCar[playerid][cars] = number;
		    new carid = GetVehicleID(number);
		    new CarPound[20];
			if(CarInfo[carid][cShtraf] > 0) CarPound = "{FF6347}[X]{FFFFFF}";
		    format(str,sizeof(str),"%s %s(%d)\n",CarPound,GetVehicleName(GetVehicleModelEx(number)),number);
		    strcat(string,str);
		    cars ++;
		}
	}
	if(!ShowPlayerDialogEx(playerid,162,2,"Мой транспорт",string,"Выбор",""))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:rules(playerid, params[])
{
	return ShowRules(playerid, INVALID_DIALOG_ID);
}

COMMAND:animation(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id;
	    if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /animation [id]");
		ApplyAnimation(playerid,AnimInfo[id][anAnimlib],AnimInfo[id][anAnimname],4.1, 0, 1, 1, 0, 0, 1);
	}
	return true;
}
new AP[6];
COMMAND:animcfg(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    sscanf(params,"dddddd",AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
		ApplyAnimationEx(playerid,PlayerAnim[playerid],4.1,AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
	}
	return true;
}

COMMAND:nextanim(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		PlayerAnim[playerid] ++;
		ApplyAnimationEx(playerid,PlayerAnim[playerid],4.1,AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
	}
	return true;
}

COMMAND:backanim(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		PlayerAnim[playerid] --;
		ApplyAnimationEx(playerid,PlayerAnim[playerid],4.1,AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
	}
	return true;
}

COMMAND:nowanim(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new string[20];
	    format(string, sizeof(string), "Anim: %d", PlayerAnim[playerid]);
	    GameTextForPlayer(playerid, string, 5000, 5);
		ApplyAnimationEx(playerid,PlayerAnim[playerid],4.1,AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
	}
	return true;
}

COMMAND:setanim(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    sscanf(params,"d",PlayerAnim[playerid]);
		ApplyAnimationEx(playerid,PlayerAnim[playerid],4.1,AP[0],AP[1],AP[2],AP[3],AP[4],AP[5]);
	}
	return true;
}

COMMAND:houseraion(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[200];
	    if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /houseraion [id]");
	    format(string,sizeof(string),"%d | %s | %d",id,HouseRaionName(id),GetHouseRaion(id));
	    SendClientMessage(playerid,-1,string);
	}
	return true;
}

COMMAND:playerinfo(playerid, params[])
{
	if(PlInfoReset[playerid]) return true;
	PlInfoReset[playerid] = 3;
	new string[300], Name[24];
	if(sscanf(params,"s[24]",Name)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /playerinfo [name]");
	new str[100],Day,Month,Year,IP[16],Time,Second,Minute,Hour,result[300],_Name[24];
	mysql_real_escape_string(Name, _Name);
	format(string, sizeof(string), "SELECT * FROM `OnlineInfo` WHERE `Name` = '%s' LIMIT 1", _Name);
	mysql_query(string);
	mysql_store_result();
	if(mysql_num_rows() == 1)
	{
		mysql_fetch_row(result, "|");
		sscanf(result,"p<|>s[24]s[16]ddddddd",
		_Name,IP,Second,Minute,Hour,Day,Month,Year,Time);
	 	string = "{FFFFFF}";
		format(str,sizeof(str),"{FFFFFF}Ник: {33CCFF}%s\n",_Name);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}Последнее посещение: {33CCFF}%d/%02d/%02d в %d:%02d\n",Day,Month,Year,Minute,Hour);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}Время пребывания: {33CCFF}%d минут(ы/у)\n",Time/60);
		strcat(string,str);
		if(PlayerInfo[playerid][pAdmin] > ADM_NONE)
		{
			format(str,sizeof(str),"{FFFFFF}IP адрес: {33CCFF}%s\n",IP);
			strcat(string,str);
		}
		if(!ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Информация о игроке",string,"Ок",""))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		}
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Об этом игроке нет информации");
	}
	mysql_free_result();
	return true;
}

COMMAND:selldrugs(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_DRUGDEALER)
	{
	    new id,count,price, string[200];
	    if(sscanf(params,"udd",id,count,price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /selldrugs [id] [Кол-во] [Цена]");
		if(ProxDetectorS(3,playerid, id))
		{
		    if(PlayerInfo[id][pPlayHours] >= 3)
		    {
		    	if(count > 0 && count < 101)
		    	{
					if(PlayerInfo[playerid][pDrugs] >= count)
					{
						if(price > 0 && price <= 1000)
						{
							format(string,sizeof(string),"{FFFFFF}Игрок %s предлагает вам купить у него %dг наркотиков за $%d\n- Нажмите 'Купить' чтобы купить\n- Нажмите 'Отмена' чтобы не покупать",PN(playerid),count,price);
							if(!ShowPlayerDialogEx(id,19,0,"Наркотики",string,"Купить","Отмена"))
							{
							    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
							}
							else
							{
								format(string,sizeof(string),"Вы предлагаете игроку %s купить у вас %dг наркотиков за $%d",PN(id),count,price);
								SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
								DrugsOffer[playerid] = id;
								DrugsOffer[id] = playerid;
								DrugsPrice[id] = price;
								DrugsCount[id] = count;
							}
						}
						else SendClientMessage(playerid, COLOR_GREY, "Стоимость должна быть не менее $1 и не более $1000");
					}
					else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько наркотиков");
				}
				else SendClientMessage(playerid, COLOR_GREY, "Кол-во должно быть не менее 1 и не более 100");
		    }
            else SendClientMessage(playerid, COLOR_GREY, "Этот игрок должен отыграть не менее 3-х часов");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы не наркодиллер ( используйте /give )");
	return true;
}

COMMAND:raionname(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[200];
	    if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /raionname [id]");
	    format(string,sizeof(string),"%d | %s",id,RaionName(id));
	    SendClientMessage(playerid,-1,string);
	}
	return true;
}

COMMAND:readuk(playerid, params[])
{
	if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new string[2000] = "{FFFFFF}";
		strcat(string,"____________________________ Меры наказания ____________________________\n");
		strcat(string,"\n1.Нападение\n\n");
		strcat(string,"1.1 Невооруженное нападение на гражданское лицо [3 уровня розыска]\n");
		strcat(string,"1.2 Вооруженное нападение на гражданское лицо [4 уровня розыска]\n");
		strcat(string,"1.3 Невооруженное нападение на представителя закона [4 уровней розыска]\n");
		strcat(string,"1.4 Вооруженное нападение на представителя закона [5 уровней розыска]\n");
		strcat(string,"\n2.Убийство\n\n");
		strcat(string,"2.1 Умышленное убийство гражданского лица [6 уровней розыска]\n");
		strcat(string,"2.2 Умышленное убийство представителя закона [8 уровней розыска]\n");
		strcat(string,"2.3 Умышленное убийство группы людей (ДМ) [7 уровней розыска]\n");
		strcat(string,"\n3.Оскорбление\n\n");
		strcat(string,"3.1 Оскорбление гражданского лица [7 уровней розыска]\n");
		strcat(string,"3.2 Оскорбление представителя закона [3 уровня розыска]\n");
		strcat(string,"\n4.Преступления против свободы\n\n");
		strcat(string,"4.1 Похищение гражданского лица без нанесения повоев [5 уровней розыска]\n");
		strcat(string,"4.2 Похищение гражданского лица с нанесением повоев [7 уровней розыска]\n");
		strcat(string,"4.3 Похищение представителя закона [10 уровней розыска]\n");
		strcat(string,"4.4 Изнасилование гражданского лица [4 уровня розыска]\n");
		strcat(string,"4.5 Изнасилование представителя закона [6 уровней розыска]\n");
		strcat(string,"4.6 Унижение гражданского лица [3 уровня розыска]\n");
		strcat(string,"4.7 Унижение представителя закона [5 уровней розыска]\n");
		strcat(string,"4.8 Попытка дачи взятки должностному лицу [3 уровня розыска]\n");
		strcat(string,"\n5.Терроризм\n\n");
		strcat(string,"5.1 Незаконное проникновение [7 уровней розыска]\n");
		strcat(string,"5.2 Срыв мероприятия [8 уровней розыска]\n");
		strcat(string,"5.3 Массовые беспорядки [8 уровней розыска]\n");
		strcat(string,"5.4 Рэкетирство [8 уровней розыска]\n");
		strcat(string,"\n6.Незаконное хранение\n\n");
		strcat(string,"6.1 Ношение оружия без лицензии на него [4 уровня розыска]\n");
		strcat(string,"6.2 Ношение материалов без лицензии на них [3 уровня розыска]\n");
		strcat(string,"6.3 Реклама о продаже наркотиков [2 уровня розыска]\n");
		strcat(string,"\n7.Похищение имущества\n\n");
	    strcat(string,"7.1 Угон чужого транспортного средства [4 уровня розыска]\n");
	    strcat(string,"\n8.Иное\n\n");
	    strcat(string,"8.1 Уход от проверки документов, инвентаря и т.д [3 уровня розыска\n");
	    strcat(string,"8.2 Выход при арресте [10 уровней розыска]\n");
	    strcat(string,"8.3 [Esc] при арресте [10 уровней розыска]\n");
	    strcat(string,"8.4 Отказ от оплаты штраффа [3 уровня розыска]\n");
	    strcat(string,"8.5 Умышленное уничтожение чужого имущества [4 уровня розыска]\n");
	    ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Меры наказания",string,"Ок","");
    }
    return true;
}

COMMAND:addcp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new text[200],Float:X, Float:Y, Float:Z;
	    if(sscanf(params,"s[150]",text)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /addcp [text]");
	    GetPlayerPos(playerid, X, Y, Z);
	    format(text,sizeof(text),"{%f, %f, %f, '%s'},",X, Y, Z, text);
	    WriteLog("CheckPoits.ini",text);
	}
	return true;
}

COMMAND:shift(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id, Float:distance;
	    if(sscanf(params,"df",id,distance)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /shift [id] [distance]");
	    return ShiftPlayer(playerid, id, distance);
    }
    return false;
}

COMMAND:scarcp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id,style, Float:distance, Float:X, Float:Y, Float:Z, Float:radi;
	    if(sscanf(params,"ddff",id,style,distance,radi)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /scarcp [id] [style] [distance] [Radius]");
	    GetVehicleShiftPos(id, style, X, Y, Z, distance);
	    return J_SetPlayerCheckpoint(playerid, X, Y, Z, radi);
    }
    return false;
}

COMMAND:bail(playerid, params[])
{
	new id, string[200];
    if(IsPlayerInRangeOfPoint(playerid,1.5,688.2541,-114.6188,1000.7209))
    {
        if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /bail [id]");
	    if(PlayerInfo[id][pJailTime] > 0)
	    {
	        if(PlayerInfo[id][pBailPrice] > 0)
	        {
	            new money = PlayerInfo[id][pBailPrice];
	            if(GetMoney(playerid) >= money)
	            {
	                format(string,sizeof(string),"Вы внесли залог за игрока %s",PN(id));
	                SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	                GiveMoney(playerid,-money,"Bail");
	                SendClientMessage(id,COLOR_LIGHTBLUE,"За вас внесли залог и вы были выпущены");
				    SetPlayerInterior(id, 0);
				    SetPlayerVirtualWorld(id, 0);
					J_SetPlayerPos(id,709.7653,-96.7917,1000.7689);
					PlayerInfo[id][pJailed] = 0;
					PlayerInfo[id][pJailTime] = 0;
					PlayerInfo[id][pBailPrice] = 0;
					new org = GetTeamID(id);
					SetCameraBehindPlayerEx(id);
					PlayerInfo[id][pSkin] = GetSkinOfPlayer(id);
					SetPlayerSkin(id,PlayerInfo[id][pSkin]);
					ResetSpawnInfo(id, org);
					SaveAccount(playerid);
					SaveAccount(id);
	            }
	            else SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег");
	        }
	        else SendClientMessage(playerid, COLOR_GREY, "У этого игрока нет залога");
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в тюрьме");
    }
    return true;
}


COMMAND:free(playerid, params[])
{
	if(IsAMeria(playerid))
	{
	    if(PlayerInfo[playerid][pRank] == 5)
	    {
	        if(!FreeReset[playerid])
	        {
				new id, string[200], price;
			    if(sscanf(params,"ud",id,price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /free [id]");
			    if(ProxDetectorS(1.5, playerid, id))
			    {
			        if(OldFreePlayer[playerid] != id)
			        {
				        if(price > 0 && price < 20000)
				        {
							new time = PlayerInfo[id][pJailTime];
						    if(time > 0)
						    {
						        if(LawyerOffer[playerid] != INVALID_PLAYER_ID)
						        {
						            format(string, sizeof(string), "Адвокат %s отменил свое предложение на сокращение срока", PN(playerid));
						            SendClientMessage(LawyerOffer[playerid], COLOR_GREY, string);
						        }

			   			     	format(string,sizeof(string),"{FFFFFF}Адвокат %s предлагает вам сократить ваш срок.\nВремя: %s\nСтоимость: за $%d", PN(id), Convert(time/2), price);
			   			     	if(!ShowPlayerDialogEx(id, 259, 0, "Сокращение срока", string, "Согласен", "Отмена"))
			   			     	{
			   			     	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			   			     	}
			   			     	else
			   			     	{
			   			     	    LawyerOffer[playerid] = id;
							        LawyerOffer[id] = playerid;
							        LawyerPrice[id] = price;
							        format(string,sizeof(string),"Вы предлагаете сократить срок %s на %s за $%d", PN(id), Convert(time/2), price);
				   			     	SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			   			     	}
						    }
						    else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в тюрьме.");
					    }
					    else SendClientMessage(playerid, COLOR_GREY, "Вы уже сокращали срок данному игроку.");
				    }
				    else SendClientMessage(playerid, COLOR_GREY, "Не менее $1 и не более $20000.");
			    }
			}
			else SendClientMessage(playerid, COLOR_GREY, "Сокращать срок можно раз в 30 секунд.");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы не адвокат.");
    }
    else SendClientMessage(playerid, COLOR_GREY, "Вы не адвокат.");
    return true;
}

COMMAND:showlics(playerid, params[])
{
	new id, string[60];
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /showlics [id]");
	if(ProxDetectorS(5.0, playerid, id))
	{
		if(ShowLicenses(id, playerid))
		{
			format(string, sizeof(string), "%s показал(а) свои лицензии %s", PN(playerid), PN(id));
			ProxDetector(10.0, playerid, string, COLOR_PURPLE);
		}
		else SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:showbadge(playerid, params[])
{
	if(IsACop(playerid))
	{
		new id, allstr[150];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /showbadge [id]");
		if(ProxDetectorS(5.0, playerid, id))
	 	{
	 		new team = GetTeamID(playerid);
			new rank = PlayerInfo[playerid][pRank];
	 		format(allstr, sizeof(allstr), "{FF9900}%s{FFFFFF}\n\nИмя: %s\nРанг: %s", TeamName(team), PN(playerid), GetRankName(team, rank));
			if(ShowPlayerDialogEx(id,INVALID_DIALOG_ID,0,"Удостоверение",allstr,"Ок",""))
			{
				format(allstr, sizeof(allstr), "%s показывает своё удостоверение %s", cPN(playerid), cPN(id));
				ProxDetector(15.0, playerid, allstr, COLOR_PURPLE);
			}
			else
			{
	   			SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	}
	return true;
}

COMMAND:showpass(playerid, params[])
{
	if(IsValidPassport(playerid))
	{
	    new id, str[50], allstr[500];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /showpass [id]");
	    if(ProxDetectorS(5.0, playerid, id))
	    {
	        new aSex[10];
	        switch(PassInfo[playerid][psSex])
	        {
	            case 0: aSex = "None";
	            case 1: aSex = "Мужчина";
	            case 2: aSex = "Женщина";
	        }
	        strcat(allstr,"{FFFFFF}");
			format(str,sizeof(str),"{FFFFFF}Имя: {33CCFF}%s\n",PN(playerid));
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Пол: {33CCFF}%s\n",aSex);
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Дата рождения: {33CCFF}%d/%d/%d\n",PassInfo[playerid][psDateBirth][0],PassInfo[playerid][psDateBirth][1],PassInfo[playerid][psDateBirth][2]);
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Серия: {33CCFF}%d\n",PassInfo[playerid][psSeria]);
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Номер: {33CCFF}%d\n",PassInfo[playerid][psNumber]);
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Дата выдачи: {33CCFF}%d/%d/%d\n",PassInfo[playerid][psDate][0],PassInfo[playerid][psDate][1],PassInfo[playerid][psDate][2]);
			strcat(allstr,str);
			format(str,sizeof(str),"{FFFFFF}Город: {33CCFF}%s\n",CityName(PassInfo[playerid][psCity]));
			strcat(allstr,str);
			format(str,sizeof(str),"{AFAFAF}Законопослушность: {33CCFF}%d\n",PlayerInfo[playerid][pZKP]);
			strcat(allstr,str);
/*			if(PlayerInfo[playerid][pHouseKey] != -1)
			{
				new house = PlayerInfo[playerid][pHouseKey];
				format(str,sizeof(str),"{FFFFFF}Адрес: {33CCFF}%s, дом №%d",HouseRaionName(house),house);
				strcat(allstr,str);
			}*/
			if(ShowPlayerDialogEx(id,INVALID_DIALOG_ID,0,"Паспорт",allstr,"Ок",""))
			{
				format(allstr, sizeof(allstr), "%s показывает свой паспорт %s", cPN(playerid), cPN(id));
				ProxDetector(15.0, playerid, allstr, COLOR_PURPLE);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	}
	return true;
}

COMMAND:showmc(playerid, params[])
{
	if(IsValidPassport(playerid))
	{
	    new id, str[60], allstr[100];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /showmc [id]");
	    if(ProxDetectorS(5.0, playerid, id))
	    {
	        new Med[30];
			switch(MedCardInfo[playerid][mcState])
			{
			    case -1: return SendClientMessage(playerid, COLOR_GREY, "У вас нет мед. карты");
			   	case 0: Med = "Не определен";
			   	case 1: Med = "Психически не здоров(а)";
			   	case 2: Med = "Наблюдаются отклонения";
			   	case 3: Med = "Полностью здоровый(ая)";
			}
	        strcat(allstr,"{FFFFFF}");
			format(str,sizeof(str),"Имя: %s\n",PN(playerid));
			strcat(allstr,str);
			format(str,sizeof(str),"Выдал: %s\n",MedCardInfo[playerid][mcGiver]);
			strcat(allstr,str);
			format(str,sizeof(str),"Дата: %s\n",MedCardInfo[playerid][mcDate]);
			strcat(allstr,str);
			format(str,sizeof(str),"Статус: %s",Med);
			strcat(allstr,str);
			if(!ShowPlayerDialogEx(id,INVALID_DIALOG_ID,0,"Мед. карта",allstr,"Ок",""))
			{
			    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
			else
			{
				format(allstr, sizeof(allstr), "%s показывает свою мед. карту %s", cPN(playerid), cPN(id));
				ProxDetector(15.0, playerid, allstr, COLOR_PURPLE);
			}
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	}
	return true;
}

COMMAND:firework(playerid, params[])
{
	if(PlayerInfo[playerid][pFireWorks] > 0)
	{
	    new Float:X,Float:Y,Float:Z,Float:A;
		GetPlayerPos(playerid,X,Y,Z);
		GetPlayerFacingAngle(playerid, A);
		ShiftCords(0, X, Y, Z, A, 1.0);
		ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.1, 0, 1, 1, 0, 2000, 1);
		new box = CreateObject( 930, X, Y, Z-0.5, 0, 0, 0 ), endobject;
		for(new i; i < 10;i ++)
		{
		    endobject = CreateObject( 19122 + random(6), X, Y, Z-0.5, 0, 0, 0 );
		}
		SetTimerEx("FireWorkStart", 3000, 0, "iiii", box, box+1, endobject, 0);
		PlayerInfo[playerid][pFireWorks] --;
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы установили фейерверк");
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"У вас нет фейерверка");
	}
	return true;
}

COMMAND:tour(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_GUIDE)
	{
	    if(InTourCar(playerid))
	    {
	        if(TourCP[playerid] == -1)
			{
		        new price;
		        if(sscanf(params,"d",price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /tour [Цена]");
		        if(price >= 1 && price <= 30)
		        {
			        TourPrice[playerid] = price;
			        TourCP[playerid] = 0;
			        SendVehicleMessage(GetPlayerVehicleID(playerid),COLOR_WHITE,TCP[0][eMessage]);
			        TogglePlayerDynamicRaceCP(playerid,Tour_CP[0],true);
			        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы начали экскурсию. Едьте по чекпоинтам");
		        }
		        else SendClientMessage(playerid, COLOR_GREY, "Цена не более $30 и не менее $1");
	        }
	        else SendClientMessage(playerid, COLOR_GREY, "Вы уже проводите экскурсию");
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "Вы не в транспорте для экскурсий");
	}
	return true;
}

COMMAND:capture(playerid, params[])
{
	if(CaptureCMDReset[playerid]) return true;
	if(IsAtGang(playerid))
	{
	    if(PlayerInfo[playerid][pRank] >= 10)
	    {
	        new org = GetTeamID(playerid);
	        if(!RecoveryTime[org])
	        {
		        new zone = GetPlayerGangZone(playerid);
		        if(zone != -1)
		        {
		            if(IsGangToZone(org, zone, 50.0))
		            {
		                new gzone = GZInfo[zone][gzFracID];
		                if(gzone != org)
		                {
							if(CaptureGZ[gzone] == -1)
							{
							    if(CapturedGZ[org] == -1)
							    {
							        if(gzone == 0)
							        {
								        StartCaptureGZ(org, zone);
							        }
							        else
							        {
								        if(IsGangConnected(gzone))
								        {
								        	StartCaptureGZ(org, zone);
								        }
								        else
									    {
									        SendClientMessage(playerid, COLOR_GREY, "Для захвата зоны должен быть онлайн хотябы 1 член банды владеющей этой зоной");
									    }
								    }
							    }
							    else
							    {
							        SendClientMessage(playerid, COLOR_GREY, "Вы уже захватываете зону");
							    }
							}
							else
						    {
						        SendClientMessage(playerid, COLOR_GREY, "Эту зону уже захватывают");
						    }
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "Это ваша зона");
						}
		            }
		            else
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Для захвата зоны хотябы половина всех членов банды должны присутствовать на захвате");
				    }
		        }
		        else
			    {
			        SendClientMessage(playerid, COLOR_GREY, "Вы не находитесь ни в одной из зон");
			    }
	        }
	        else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Ваша банда ещё не восстановила силы");
		    }
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Для захвата зоны необходмо иметь ранг не менее 10-го");
	    }
	}
	return true;
}

COMMAND:newcodes(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
    	new count, string[150];
		if(sscanf(params,"d",count)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /newcodes [Кол-во]");
		for(new i;i < count;i ++)
		{
		    new str[20];
		    for(new c;c < 14;c ++) str[c] = PassSimbols[random(sizeof(PassSimbols))];
		 	new File:hFile = fopen("[Donate]/Donate.ini", io_append);
		 	format(string, sizeof(string), "%s\r\n",str);
		 	for(new s; s < strlen(string); s ++) fputchar(hFile, string[s], false);
		 	fclose(hFile);
		}
		SendClientMessage(playerid, COLOR_YELLOW, "Готово!");
	}
	return true;
}

COMMAND:bandana(playerid, params[])
{
	if(PlayerInfo[playerid][pBandans])
	{
	    new id;
		if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /bandana [1 - 10 (0 чтобы снять)]");
		if(id < 0 || id > 10) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /bandana [1 - 10 (0 чтобы снять)]");
		if(id == 0) RemovePlayerAttachedObjectEx(playerid,4);
		else
		{
			new skin = GetPlayerSkin(playerid);
		    SetPlayerAttachedObjectEx(playerid, 4, 18910 + id, 2, -PosX[skin][0], 0.025, -0.005, 90.0, 180.0, 90.0, 1.05, 1.05, 1.05);
		    return true;
	    }
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "У вас нет бандан, купите их в 24/7");
	}
	return true;
}

COMMAND:glasses(playerid, params[])
{
	if(PlayerInfo[playerid][pGlasses])
	{
	    new id;
		if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /glasses [1 - 30 (0 чтобы снять)]");
		if(id < 0 || id > 30) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /glasses [1 - 30 (0 чтобы снять)]");
		if(id == 0) return RemovePlayerAttachedObjectEx(playerid, 5);
		else
		{
			new skin = GetPlayerSkin(playerid);
	  		SetPlayerAttachedObjectEx(playerid, 5, 19005 + id, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
			return true;
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "У вас нет очков, купите их в 24/7");
	}
	return true;
}

COMMAND:hat(playerid, params[])
{
	if(PlayerInfo[playerid][pHats])
	{
	    new id;
		if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /hat [1 - 15 (0 чтобы снять)]");
		if(id < 0 || id > 30) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /hat [1 - 15 (0 чтобы снять)]");
		if(id == 0) return RemovePlayerAttachedObjectEx(playerid, 4);
		new skin = GetPlayerSkin(playerid);
		switch(id)
		{
			case 1: SetPlayerAttachedObjectEx(playerid, 4, 18944, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 2: SetPlayerAttachedObjectEx(playerid, 4, 18945, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 3: SetPlayerAttachedObjectEx(playerid, 4, 18946, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 4: SetPlayerAttachedObjectEx(playerid, 4, 18947, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 5: SetPlayerAttachedObjectEx(playerid, 4, 18948, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 6: SetPlayerAttachedObjectEx(playerid, 4, 18949, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 7: SetPlayerAttachedObjectEx(playerid, 4, 18950, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 8: SetPlayerAttachedObjectEx(playerid, 4, 18951, 2, PosX[skin][10], 0, 0, 180, 0, 10);
			case 9: SetPlayerAttachedObjectEx(playerid, 4, 18967, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 10: SetPlayerAttachedObjectEx(playerid, 4, 18968, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 11: SetPlayerAttachedObjectEx(playerid, 4, 18969, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 12: SetPlayerAttachedObjectEx(playerid, 4, 18970, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 13: SetPlayerAttachedObjectEx(playerid, 4, 18971, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 14: SetPlayerAttachedObjectEx(playerid, 4, 18972, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 15: SetPlayerAttachedObjectEx(playerid, 4, 18973, 2, PosX[skin][6], 0.015, 0, 90, 80);
			case 16: SetPlayerAttachedObjectEx(playerid, 4, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.2, 1.2, 1.2);
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "У вас нет шляп, купите их в 24/7");
	}
	return true;
}

/*COMMAND:inv(playerid, params[])
{
	return cmd_inventory(playerid, "");
}

COMMAND:inventory(playerid, params[])
{
	if(GunReset[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, "Подождите 2-3 секунды...");
	if(GunUP[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Запрещено так как вы взяли набор!");
	if(PlayerTir[playerid] != -1) return SendClientMessage(playerid, COLOR_GREY, "Нельзя использовать в тире!");
	if(PlayerInfo[playerid][pInvGun] > 0 && PlayerInfo[playerid][pInvGun] <= 46)
	{
	    new string[150];
	    new gunid = PlayerInfo[playerid][pInvGun];
        new ammo = PlayerInfo[playerid][pInvAmmo];
	    format(string,sizeof(string),"* %s просматривает свой инвентарь",cPN(playerid));
	    ProxDetector(10,playerid,string,COLOR_PURPLE);
	    format(string,sizeof(string),"{10F441}Оружие: {33CCFF}%s\n{10F441}Боеприпасы: {33CCFF}%d",GunName(gunid),ammo);
	    SendClientMessage(playerid,COLOR_GREY,string);
	    ShowPlayerDialogEx(playerid,137,0,"Инвентарь",string,"Достать","Отмена");
	}
	else
	{
	    PlayerInfo[playerid][pInvGun] = 0;
		PlayerInfo[playerid][pInvAmmo] = 0;
	    if(!ShowPlayerDialogEx(playerid,137,0,"Инвентарь","{FFFFFF}В вашем инвентаре нет оружия.\nХотите положить туда своё оружие?","Положить","Отмена"))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		}
	}
	GunReset[playerid] = 3;
	return true;
}*/

COMMAND:resbans(playerid,param[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		SendRconCommand("reloadbans");
	}
	return true;
}

COMMAND:intro(playerid,param[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    SetPlayerCameraPos(playerid,1339.5564,-1586.8918,137.3797);
		SetPlayerCameraLookAt(playerid,1529.7321,-1711.8347,13.3828);
	}
	return true;
}

COMMAND:slap(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!AdminInfo[playerid][aSlap]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		new id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /slap [id]");
		if(IsPlayerConnected(id))
		{
			if(!SlapReset[playerid])
			{
				if(PlayerInfo[id][pAdmin] <= PlayerInfo[playerid][pAdmin])
				{
				    new Float:X,Float:Y,Float:Z,string[100];
				    GetPlayerPos(id,X,Y,Z);
				    SetPlayerPos(id,X,Y,Z+5);
				    format(string,sizeof(string),"** Админ/Модер %s подкинул игрока %s[%d]",PN(playerid),PN(id),id);
					SendAdminsMessage(COLOR_LIGHTRED,string,1);
					if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN) SlapReset[playerid] = 5;
				}
			}
			else SendClientMessage(playerid, COLOR_GREY, "Подкидывать игроков можно только раз в 5 секунд");
		}
	}
	return true;
}

COMMAND:resguns(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
		new id;
		if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /resguns [id]");
		if(PlayerInfo[id][pAdmin] <= PlayerInfo[playerid][pAdmin])
		{
			new string[150];
		   	J_ResetPlayerWeapons(id);
		   	format(string,sizeof(string),"Вы отобрали оружие у игрока %s[%d]",PN(id),id);
		   	SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		}
	}
	return true;
}

COMMAND:eat(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(PlayerInfo[playerid][pCheeps])
		{
		    if(!ShowPlayerDialogEx(playerid,192,2,"Выберите еду","Чипсы","Есть","Отмена"))
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		    }
		}
	}
	return true;
}

COMMAND:respickups(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
    	ResetPickups();
    }
    return true;
}

COMMAND:drink(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(HouseEntered[playerid] != -1)
	    {
	        if(HouseInfo[HouseEntered[playerid]][hBar])
	        {
		        ShowPlayerDialogEx(playerid,97,2,"Выберите напиток","Спранк \t\t[$2]\nМолочный коктейль \t[$3]\nПиво \t\t\t[$3]\nВодка \t\t\t[$4]\nКоньяк \t\t[$5]\nВиски \t\t\t[$6]","Выбор","Отмена");
			}
			else SendClientMessage(playerid,COLOR_GREY,"В этом доме нет бара");
		}
		else if(PlayerInfo[playerid][pSprunk] || PlayerInfo[playerid][pBeer])
		{
		    ShowPlayerDialogEx(playerid,191,2,"Выберите напиток","Спранк\nПиво","Пить","Отмена");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы не находитесь ни в 1-ом из домов");
	}
	return true;
}

COMMAND:putme(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    SetPlayerTimer(playerid,"PutInCar",2000,false);
	}
	return false;
}

COMMAND:fwarn(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
		new id,reason[150],string[200];
		if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /fwarn [id] [причина]");
		if(IsPlayerConnected(id))
		{
		    if(IsGiveWarn(playerid, id))
		    {
		        PlayerInfo[id][pFWarns] ++;
		        format(string,sizeof(string),"Вы дали выговор игроку %s с причиной %s",PN(id),reason);
		        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		        format(string,sizeof(string),"%s дал вам выговор с причиной %s",PN(playerid),reason);
		        SendClientMessage(id,COLOR_LIGHTRED,string);
				if(PlayerInfo[id][pFWarns] >= 3)
				{
				    PlayerInfo[id][pFWarns] = 0;
				    SendClientMessage(id,COLOR_GREY,"Вы были автоматически выгнаны из организации т.к у вас больше 2-х выговоров");
				    format(string,sizeof(string),"%s покидает нашу организацию т.к у него больше 2-х выговоров",PN(id));
				    SendTeamMessage(PlayerInfo[id][pMember],COLOR_GREY,string);
				    PlayerInfo[id][pMember] = 0;
			        PlayerInfo[id][pRank] = 0;
			        SetBumSkin(id);
			    	PlayerSpawn(id);
				}
		    }
		}
	}
	return true;
}

COMMAND:unfwarn(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
		new id,string[200];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unfwarn [id]");
		if(IsPlayerConnected(id))
		{
		    if(GetTeamID(id) == GetTeamID(playerid))
		    {
				if(PlayerInfo[id][pFWarns] > 0)
				{
			        PlayerInfo[id][pFWarns] --;
			        format(string,sizeof(string),"Вы сняли выговор игроку %s",PN(id));
			        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			        format(string,sizeof(string),"%s снял вам выговор",PN(playerid));
			        SendClientMessage(id,COLOR_LIGHTRED,string);
		        }
		    }
		}
	}
	return true;
}

COMMAND:knock(playerid, params[])
{
	new house = InfoHouse[playerid];
	if(house == -1) return true;
	if(IsPlayerInDynamicCP(playerid, HouseCP[house]))
	{
	    for(new i; i < GetMaxPlayersEx(); i ++)
	    {
	        if(HouseEntered[i] == house)
	        {
	            SendClientMessage(i, COLOR_WHITE, "В дверь кто-то стучится");
			    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы стучитесь в дверь");

	        }
	    }
	}
	return true;
}

COMMAND:delcar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(IsPlayerInAnyVehicle(playerid))
	    {
			new carid = GetPlayerVehicleID(playerid);
			if(carid >= CreatedCar[0] && carid < CreatedCar[CREATEDCARS])
			{
			    for(new i;i < CREATEDCARS;i ++)
			    {
			        if(carid == CreatedCar[i])
			        {
			            for(new s = i;s < CREATEDCARS; s ++)
			            {
			                CreatedCar[s] = CreatedCar[s+1];
			            }
			            CREATEDCARS --;
			            break;
			        }
			    }
			}
	        return DestroyVehicleEx(GetPlayerVehicleID(playerid));
	    }
	}
	return true;
}

COMMAND:ad(playerid, params[])
{
    new result[150],string[200];
    if(PlayerInfo[playerid][pLevel] >= 3)
    {
		if(!AdReset)
		{
		    if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /ad [Текст]");
			new money = floatround(strlen(result)/6);
			if(GetMoney(playerid) >= money)
			{
	   			format(string,sizeof(string),"Объявление: %s | От: %s, Тел.: %d",result,PN(playerid),PlayerInfo[playerid][pTelNum]);
		 		SendClientMessageToAll(COLOR_GREEN,string);
		 		GiveMoney(playerid,-money,"Реклама");
		 		OrgInfo[TEAM_RADIO][oBank] += money;
				AdReset = 180;
				return true;
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"У вас недостаточно денег");
			}
		}
		else
		{
		    format(string,sizeof(string),"Подать рекламу можно будет только через %d секунд(ы)",AdReset);
			SendClientMessage(playerid,COLOR_GREY,string);
		}
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"Подавать рекламу можно только с 3-го уровня");
	}
	return true;
}

COMMAND:sameips(playerid, params[])
{
	new string[2000],str[60],bool:SameIP[MAX_PLAYERS];
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    for(new i;i < GetMaxPlayersEx();i ++)
	    {
	        if(IsPlayerConnected(i))
		    {
	        	if(!SameIP[i])
	        	{
			        new bool:sameip;
		            for(new p;p < GetMaxPlayersEx(); p ++)
			    	{
			    	    if(i != p)
			    	    {
				    	    if(IsPlayerConnected(p))
				    	    {
				    	        if(GetString(PlayerIP(i),PlayerIP(p)))
						        {
						        	SameIP[i] = true;
						        	SameIP[p] = true;
						    	    if(!sameip)
									{
										format(str,sizeof(str),"{%s}%s[%d] - %s\n",SIPColors[random(15)],PN(i),i,PlayerIP(i));
						    	       	strcat(string,str);
						    	       	sameip = true;
									}
						    	    format(str,sizeof(str),"%s[%d] - %s\n",PN(p),p,PlayerIP(p));
						    	    strcat(string,str);
					    	    }
				    	    }
			    	    }
		    	    }
		    	    if(sameip) strcat(string,"\n");
		    	}
	    	}
	    }
	    ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Игроки с одинаковыми IP",string,"Ок","");
	}
	return true;
}

COMMAND:saveakk(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    for(new i;i < GetMaxPlayersEx();i ++)
	    {
	        if(IsPlayerConnected(i))
	        {
		        if(IsPlayerLogged[i])
		        {
		            SaveAccount(i);
		        }
	        }
	    }
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Все аккаунты сохранены");
	}
	return true;
}

COMMAND:spawn(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    PlayerSpawn(playerid);
	}
	return true;
}

COMMAND:gotome(playerid, params[])
{
	if(IsACop(playerid))
	{
	    new id, string[150];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /gotome [id]");
		if(ProxDetectorS(1.0, playerid, id))
		{
		    if(GotoInfo[playerid][gtID] == INVALID_PLAYER_ID)
		    {
		        if(GotoInfo[id][gtGoID] == INVALID_PLAYER_ID)
		        {
					if(Cuffed[id])
					{
                        CheckPlayerGoCuff(playerid);
                        CheckPlayerGoCuff(id);
					    GotoInfo[id][gtID] = INVALID_PLAYER_ID;
					    GotoInfo[playerid][gtGoID] = INVALID_PLAYER_ID;
					    GotoInfo[playerid][gtID] = id;
					    GotoInfo[id][gtGoID] = playerid;
					    GotoInfo[id][gtState] = GetPlayerState(playerid);
					    GetPlayerPos(id, GotoInfo[id][gtX], GotoInfo[id][gtY], GotoInfo[id][gtZ]);
					    SendClientMessage(playerid, COLOR_WHITE, "Чтобы перестать тащить игрока введите {33AA33}/ungotome");
					    format(string, sizeof(string), "* %s потащил игрока %s за собой", cPN(playerid), cPN(id));
					    ProxDetector(10.0, playerid, string, COLOR_PURPLE);
					    J_TogglePlayerControllable(id, true);
					}
					else SendClientMessage(playerid, COLOR_GREY, "Игрок не скован");
		        }
		        else SendClientMessage(playerid, COLOR_GREY, "Этого игрока уже кто-то ведет за собой");
		    }
		    else SendClientMessage(playerid, COLOR_GREY, "Вы уже кого-то ведете за собой");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	}
	return true;
}

COMMAND:ungotome(playerid, params[])
{
	if(IsACop(playerid))
	{
		new string[200], id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /ungotome [id/name]");
		if(ProxDetectorS(1.5,playerid,id))
		{
			if(Cuffed[id] && GotoInfo[playerid][gtID] == id)
			{
				format(string,sizeof(string),"* %s перестал тащить за собой игрока %s",cPN(playerid),cPN(id));
				ProxDetector(15,playerid,string,COLOR_PURPLE);
				J_TogglePlayerControllable(id, Cuffed[id]);
				CheckPlayerGoCuff(playerid);
			}
			else
			{
			    return SendClientMessage(playerid, -1, "Игрок не скован, либо вы не тащите его");
			}
		}
	}
	return true;
}

COMMAND:heal(playerid, params[])
{
	if(GetTeamID(playerid) == TEAM_M4C)
	{
	    if(!HealReset[playerid])
	    {
		    new price,id,string[150];
		    if(sscanf(params,"ud",id,price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /heal [id] [цена]");
			if(ProxDetectorS(3,playerid,id))
			{
			    if(price > 0)
			    {
			        if(price > 30) return SendClientMessage(playerid,COLOR_GREY,"За свои услуги вы можете брать не более $30");
					format(string,sizeof(string),"Медик %s хочет вылечить вас за $%d",cPN(playerid),price);
					if(ShowPlayerDialogEx(id,131,0,"Лечение",string,"Ок","Отмена"))
					{
						HealOffer[id] = playerid;
						HealPrice[id] = price;
					}
					else SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			    }
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Вы далеко от игрока");
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"Лечить можно раз в 10 секунд");
		}
	}
	return true;
}

COMMAND:number(playerid, params[])
{
	if(PlayerInfo[playerid][pPhoneBook])
	{
	    new id,string[100];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /number [id]");
	    if(IsPlayerConnected(playerid))
	    {
	        format(string,sizeof(string),"{FFFFFF}Номер игрока %s[%d]: {33CCFF}%d",PN(id),id,PlayerInfo[id][pTelNum]);
			if(!ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Телефонная книга",string,"Ок",""))
			{
			    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
	    }
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"У вас нет телефонной книжки");
	}
	return true;
}

COMMAND:radio(playerid, params[])
{
	if(PlayerInfo[playerid][pRadio])
	{
	    if(PlayRadio[playerid])
	    {
	        if(!ShowPlayerDialogEx(playerid,116,2,"Выберите пункт","Другая радиостанция\n{AFAFAF}Выключить радио","Выбор","Отмена"))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	        }
	    }
	    else
	    {
		    new string[50],allstr[1000],radios = 1;
			for(new i;i < sizeof(RadioInfo);i ++)
			{
			    format(string,sizeof(string),"[%d]%s\n",radios,RadioInfo[i][rdName]);
			    strcat(allstr,string);
			    radios ++;
			}
			if(radios > 1)
			{
				if(!ShowPlayerDialogEx(playerid,117,2,"Выберите радиостанцию",allstr,"Слушать","Отмена"))
				{
				    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
				}
			}
		}
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"У вас нет радио");
	}
	return true;
}

COMMAND:loadquestions(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		LoadQuestions();
		SendClientMessage(playerid,COLOR_YELLOW,"Вопросы загружены");
	}
	return true;
}

COMMAND:fishes(playerid, params[])
{
	new str[20],string[200];
	for(new i;i < 5;i ++)
	{
		format(str,sizeof(str),"%s\n",FishName[PlayerFish[playerid][i]]);
		strcat(string,str);
	}
	if(!ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Список рыб",string,"Ок",""))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:fished(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		return PlayerFishing(playerid);
	}
	return true;
}

COMMAND:go_fished(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    if(!InJob[playerid])
	    {
		    if(PlayerInfo[playerid][pSpining])
		    {
		        if(PlayerInfo[playerid][pWorms] > 0)
		        {
		            if(!Fishing[playerid])
		            {
						for(new i;i < sizeof(FishZone);i ++)
						{
						    if(IsPlayerInRangeOfPoint(playerid,2.0,FishZone[i][0],FishZone[i][1],FishZone[i][2]))
						    {
						        new string[150];
						        SetPlayerArmedWeapon(playerid, 0);
						        SetPlayerAttachedObjectEx(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
						        J_TogglePlayerControllable(playerid, false);
						        ApplyAnimation(playerid,"SWORD","SWORD_3",4.1, 0, 1, 1, 1, 0, 1);
								format(string,sizeof(string),"* %s закидывает крючек и ловит рыбу",cPN(playerid));
								ProxDetector(10,playerid,string,COLOR_PURPLE);
								SetPlayerTimer(playerid,"PlayerFishing",3000 + random(3000),false);
								Fishing[playerid] = true;
						    }
						}
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GREY,"Вы уже ловите рыбу");
					}
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GREY,"У вас нет наживки");
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"У вас нет удочки");
			}
		}
		else
		{
			SendClientMessage(playerid,COLOR_GREY,"Нельзя рыбачить во время работы");
		}
	}
	return true;
}

COMMAND:seatbelt(playerid, params[])
{
	new string[150];
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new carid = GetPlayerVehicleID(playerid);
	    if(IsACar(carid))
		{
			if(Seatbelt[playerid])
			{
			    Seatbelt[playerid] = false;
			    format(string,sizeof(string),"* %s отстегнул(а) ремень безопасности",cPN(playerid));
			    ProxDetector(7,playerid,string,COLOR_PURPLE);
			}
			else
			{
			    Seatbelt[playerid] = true;
			    format(string,sizeof(string),"* %s пристегнул(а) ремень безопасности",cPN(playerid));
			    ProxDetector(7,playerid,string,COLOR_PURPLE);
			}
		}
	}
	return true;
}

COMMAND:interprice(playerid, params[])
{
	if(PlayerInfo[playerid][pBizKey] != -1)
	{
	    new price, biz = PlayerInfo[playerid][pBizKey];
	    if(sscanf(params,"f",price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /interprice [price]");
	    if(price > 0 && price <= 50)
	    {
	        BizInfo[biz][bEnterPrice] = price;
	        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы установили новую стоимость входа");
	    }
	}
	return true;
}

COMMAND:mark(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    GetPlayerPos(playerid,PlayerInfo[playerid][pMark_X],PlayerInfo[playerid][pMark_Y],PlayerInfo[playerid][pMark_Z]);
	    PlayerInfo[playerid][pMark_Int] = GetPlayerInterior(playerid);
	    PlayerInfo[playerid][pMark_VW] = GetPlayerVirtualWorld(playerid);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Позиция отмечена");
	}
	return true;
}

COMMAND:gotozm(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    SetPlayerInterior(playerid,0);
	    SetPlayerVirtualWorld(playerid,0);
	    J_SetPlayerPos(playerid,689.32897949,-103.59700012,1003.07202148);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы были телепортированы");
	}
	return true;
}

COMMAND:gotomark(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    SetPlayerInterior(playerid,PlayerInfo[playerid][pMark_Int]);
	    SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pMark_VW]);
	    J_SetPlayerPos(playerid,PlayerInfo[playerid][pMark_X],PlayerInfo[playerid][pMark_Y],PlayerInfo[playerid][pMark_Z]);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы были телепортированы");
	}
	return true;
}

COMMAND:banlist(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
		if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
		{
	    	if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    	new string[700], Name[24];
	        mysql_query("SELECT `Name` FROM `BanNames` ORDER BY `ID` DESC LIMIT 0 , 20");
	        mysql_store_result();
	        new accounts = mysql_num_rows();
	        if(accounts == 0) return SendClientMessage(playerid, COLOR_GREY, "Список забаненных пуст");
	        FirstBL[playerid] = 0;
	        for(new i; i < accounts; i ++)
	        {
			    mysql_fetch_string(Name);
	            format(string, sizeof(string), "%s%s\n", string, Name);
	        }
	        if(accounts == 20)
	        {
	        	format(string, sizeof(string), "%s{AFAFAF}Далее >>>\n", string);
	        }
			mysql_free_result();
	        if(!ShowPlayerDialogEx(playerid, 96, 2, "Забаненые", string, "Выбор", "Назад"))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	        }
		}
	}
	return true;
}

COMMAND:mask(playerid, params[])
{
	if(PlayerInfo[playerid][pLevel] >= 3)
	{
	    if(!IsANotControllable(playerid))
	    {
		    if(!InMP[playerid])
		    {
				if(PlayerInfo[playerid][pMask])
				{
				    if(PlayerInfo[playerid][pMaskON])
				    {
				        PlayerInfo[playerid][pMaskON] = false;
				        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы сняли маску");
				        RemovePlayerAttachedObjectEx(playerid, 1);
				    }
					else
					{
					    if(IsAtGang(playerid) || IsAtMafia(playerid))
					    {
						    new id;
						    if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /mask [1-5]");
						    if(!id || id > 5) return SendClientMessage(playerid, -1, "Используй: /mask [1-5]");
						    new skin = GetPlayerSkin(playerid);
						    switch(id-1)
							{
							    case 0: SetPlayerAttachedObjectEx(playerid, 5, 19036, 2, PosX[skin][5], 0.02,   0, 90, 90); //Hockeymask1
							    case 1: SetPlayerAttachedObjectEx(playerid, 5, 19037, 2, PosX[skin][5], 0.02,   0, 90, 90); //Hockeymask2
							    case 2: SetPlayerAttachedObjectEx(playerid, 5, 19038, 2, PosX[skin][5], 0.02,   0, 90, 90); //Hockeymask3
							    case 3: SetPlayerAttachedObjectEx(playerid, 5, 18974, 2, PosX[skin][3], 0.0258, 0, 90, 90); //Zorromask
							    case 4: SetPlayerAttachedObjectEx(playerid, 5, 18952, 2, PosX[skin][4], 0.01); //Boxing
							}
						    PlayerInfo[playerid][pMaskON] = true;
					        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы одели маску");
				        }
				        else SendClientMessage(playerid, COLOR_GREY, "Только члены банд и мафий могут надевать маски");
					}
				}
				UpdateHPBar(playerid);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "У вас нет масок, купите их в 24/7");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Вы не можете двигаться");
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "Пользоваться масками можно только достигнув 3-го уровня");
	}
	return true;
}

COMMAND:startlotto(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new string[100];
		new lotto = 1+random(100);
   	    new wins;
   	    for(new i;i < GetMaxPlayersEx(); i ++)
   	    {
   	        if(IsPlayerConnected(i))
   	        {
	   	        if(PlayerInfo[i][pLotto] == lotto)
	   	        {
	   	            wins ++;
	   	            if(wins == 1) SendClientMessageToAll(COLOR_GREEN,"_________Список победителей__________");
	   	            format(string,sizeof(string),"%d-й победитель: %s",wins,PN(i));
	   	            SendClientMessageToAll(COLOR_WHITE,string);
	   	        }
   	        }
   	    }
   	    if(wins > 0) SendClientMessageToAll(COLOR_GREEN,"_______________________________________");
   	    new summa = JackPod/wins;
   	    format(string,sizeof(string),"Каждый из них получает по $%d",summa);
   	    SendClientMessageToAll(COLOR_LIGHTBLUE,string);
   	    JackPod = 301 + random(2700);
   	    format(string,sizeof(string),"Jackpod = $%d",JackPod);
   	    SendClientMessageToAll(COLOR_LIGHTRED,string);
	}
	return true;
}

COMMAND:settime(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new hour;
	    if(sscanf(params,"d",hour)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /settime [hour]");
	    SetWorldTime(hour);
	}
	return true;
}

COMMAND:setadmconfines(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(AdminInfo[playerid][aRedPlayers])
	    {
		    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		    new string[30],allstr[1000],id;
		    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setadmconfines [id]");
		    if(IsPlayerConnected(id))
			{
			    if(PlayerInfo[id][pAdmin] < ADM_GRAND_ADMIN || AdminInfo[playerid][aRedAdmins])
			    {
				    ConfinesID[playerid] = id;
					format(string,sizeof(string),"Kick: \t\t%s\n",YesOrNo(AdminInfo[id][aKick]));
					strcat(allstr,string);
					format(string,sizeof(string),"Spec: \t\t%s\n",YesOrNo(AdminInfo[id][aSpec]));
					strcat(allstr,string);
					format(string,sizeof(string),"Ban: \t\t%s\n",YesOrNo(AdminInfo[id][aBan]));
					strcat(allstr,string);
					format(string,sizeof(string),"BanIP: \t\t%s\n",YesOrNo(AdminInfo[id][aBanIP]));
					strcat(allstr,string);
					format(string,sizeof(string),"Mute: \t\t%s\n",YesOrNo(AdminInfo[id][aMute]));
					strcat(allstr,string);
					format(string,sizeof(string),"Warn: \t\t%s\n",YesOrNo(AdminInfo[id][aWarn]));
					strcat(allstr,string);
					format(string,sizeof(string),"Slap: \t\t%s\n",YesOrNo(AdminInfo[id][aSlap]));
					strcat(allstr,string);
					format(string,sizeof(string),"Check: \t\t%s\n",YesOrNo(AdminInfo[id][aCheck]));
					strcat(allstr,string);
					format(string,sizeof(string),"Freeze: \t%s\n",YesOrNo(AdminInfo[id][aFreeze]));
					strcat(allstr,string);
					format(string,sizeof(string),"SellCar: \t%s\n",YesOrNo(AdminInfo[id][aSellCar]));
					strcat(allstr,string);
					format(string,sizeof(string),"MakeCar: \t%s\n",YesOrNo(AdminInfo[id][aMakeCar]));
					strcat(allstr,string);
					format(string,sizeof(string),"SellHouse: \t%s\n",YesOrNo(AdminInfo[id][aSellHouse]));
					strcat(allstr,string);
					format(string,sizeof(string),"MakeHouse: \t%s\n",YesOrNo(AdminInfo[id][aMakeHouse]));
					strcat(allstr,string);
					format(string,sizeof(string),"Gethere: \t%s\n",YesOrNo(AdminInfo[id][aGethere]));
					strcat(allstr,string);
					format(string,sizeof(string),"Gotoid: \t%s\n",YesOrNo(AdminInfo[id][aGotoid]));
					strcat(allstr,string);
					format(string,sizeof(string),"SetVW: \t\t%s\n",YesOrNo(AdminInfo[id][aSetVW]));
					strcat(allstr,string);
					format(string,sizeof(string),"SetName: \t%s\n",YesOrNo(AdminInfo[id][aSetName]));
					strcat(allstr,string);
					format(string,sizeof(string),"GiveLicense: \t%s\n",YesOrNo(AdminInfo[id][aGiveLicense]));
					strcat(allstr,string);
					format(string,sizeof(string),"GiveGun: \t%s\n",YesOrNo(AdminInfo[id][aGiveGun]));
					strcat(allstr,string);
					format(string,sizeof(string),"SetStat: \t%s\n",YesOrNo(AdminInfo[id][aSetStat]));
					strcat(allstr,string);
					format(string,sizeof(string),"UnBan: \t%s\n",YesOrNo(AdminInfo[id][aUnBan]));
					strcat(allstr,string);
					format(string,sizeof(string),"UnInvite: \t%s\n",YesOrNo(AdminInfo[id][aUnInvite]));
					strcat(allstr,string);
					format(string,sizeof(string),"MakeLeader: \t%s\n",YesOrNo(AdminInfo[id][aMakeLeader]));
					strcat(allstr,string);
					format(string,sizeof(string),"MakeAdmin: \t%s\n",YesOrNo(AdminInfo[id][aMakeAdmin]));
					strcat(allstr,string);
					format(string,sizeof(string),"MakeHelper: \t%s\n",YesOrNo(AdminInfo[id][aMakeHelper]));
					strcat(allstr,string);
					format(string,sizeof(string),"OOC: \t\t%s\n",YesOrNo(AdminInfo[id][aOOC]));
					strcat(allstr,string);
					format(string,sizeof(string),"SetCarPrice: \t%s\n",YesOrNo(AdminInfo[id][aSetCarPrice]));
					strcat(allstr,string);
					format(string,sizeof(string),"GiveMoney: \t%s\n",YesOrNo(AdminInfo[id][aGiveMoney]));
					strcat(allstr,string);
					format(string,sizeof(string),"AdminOOC: \t%s\n",YesOrNo(AdminInfo[id][aAdminOOC]));
					strcat(allstr,string);
					format(string,sizeof(string),"SetSkin: \t%s\n",YesOrNo(AdminInfo[id][aSetSkin]));
					strcat(allstr,string);
					format(string,sizeof(string),"FixVeh: \t\t%s\n",YesOrNo(AdminInfo[id][aFixVeh]));
					strcat(allstr,string);
					format(string,sizeof(string),"FuelVeh: \t%s\n",YesOrNo(AdminInfo[id][aFuelVeh]));
					strcat(allstr,string);
					format(string,sizeof(string),"Answer: \t%s\n",YesOrNo(AdminInfo[id][aAnswer]));
					strcat(allstr,string);
					format(string,sizeof(string),"Veh: \t\t%s\n",YesOrNo(AdminInfo[id][aVeh]));
					strcat(allstr,string);
					format(string,sizeof(string),"Jail: \t\t%s\n",YesOrNo(AdminInfo[id][aJail]));
					strcat(allstr,string);
					format(string,sizeof(string),"RedPlayers: \t%s\n",YesOrNo(AdminInfo[id][aRedPlayers]));
					strcat(allstr,string);
					format(string,sizeof(string),"RedAdmins: \t%s\n",YesOrNo(AdminInfo[id][aRedAdmins]));
					strcat(allstr,string);
					ShowPlayerDialogEx(playerid,90,2,"Администраторские ограничения",allstr,"Изменить","Отмена");
				}
				else SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не можете редактировать главных администраторов");
			}
		}
		else SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	}
	return true;
}

COMMAND:myconfines(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new string[30],allstr[1000];
	    if(IsPlayerConnected(playerid))
		{
		    strcat(allstr,"{9ACD32}");
			format(string,sizeof(string),"Kick: \t\t%s\n",YesOrNo(AdminInfo[playerid][aKick]));
			strcat(allstr,string);
			format(string,sizeof(string),"Spec: \t\t%s\n",YesOrNo(AdminInfo[playerid][aSpec]));
			strcat(allstr,string);
			format(string,sizeof(string),"Ban: \t\t%s\n",YesOrNo(AdminInfo[playerid][aBan]));
			strcat(allstr,string);
			format(string,sizeof(string),"BanIP: \t\t%s\n",YesOrNo(AdminInfo[playerid][aBanIP]));
			strcat(allstr,string);
			format(string,sizeof(string),"Mute: \t\t%s\n",YesOrNo(AdminInfo[playerid][aMute]));
			strcat(allstr,string);
			format(string,sizeof(string),"Warn: \t\t%s\n",YesOrNo(AdminInfo[playerid][aWarn]));
			strcat(allstr,string);
			format(string,sizeof(string),"Slap: \t\t%s\n",YesOrNo(AdminInfo[playerid][aSlap]));
			strcat(allstr,string);
			format(string,sizeof(string),"Check: \t%s\n",YesOrNo(AdminInfo[playerid][aCheck]));
			strcat(allstr,string);
			format(string,sizeof(string),"Freeze: \t%s\n",YesOrNo(AdminInfo[playerid][aFreeze]));
			strcat(allstr,string);
			format(string,sizeof(string),"SellCar: \t%s\n",YesOrNo(AdminInfo[playerid][aSellCar]));
			strcat(allstr,string);
			format(string,sizeof(string),"MakeCar: \t%s\n",YesOrNo(AdminInfo[playerid][aMakeCar]));
			strcat(allstr,string);
			format(string,sizeof(string),"SellHouse: \t%s\n",YesOrNo(AdminInfo[playerid][aSellHouse]));
			strcat(allstr,string);
			format(string,sizeof(string),"MakeHouse: \t%s\n",YesOrNo(AdminInfo[playerid][aMakeHouse]));
			strcat(allstr,string);
			format(string,sizeof(string),"Gethere: \t%s\n",YesOrNo(AdminInfo[playerid][aGethere]));
			strcat(allstr,string);
			format(string,sizeof(string),"Gotoid: \t%s\n",YesOrNo(AdminInfo[playerid][aGotoid]));
			strcat(allstr,string);
			format(string,sizeof(string),"SetVW: \t%s\n",YesOrNo(AdminInfo[playerid][aSetVW]));
			strcat(allstr,string);
			format(string,sizeof(string),"SetName: \t%s\n",YesOrNo(AdminInfo[playerid][aSetName]));
			strcat(allstr,string);
			format(string,sizeof(string),"GiveLicense: \t%s\n",YesOrNo(AdminInfo[playerid][aGiveLicense]));
			strcat(allstr,string);
			format(string,sizeof(string),"GiveGun: \t%s\n",YesOrNo(AdminInfo[playerid][aGiveGun]));
			strcat(allstr,string);
			format(string,sizeof(string),"SetStat: \t%s\n",YesOrNo(AdminInfo[playerid][aSetStat]));
			strcat(allstr,string);
			format(string,sizeof(string),"UnBan: \t%s\n",YesOrNo(AdminInfo[playerid][aUnBan]));
			strcat(allstr,string);
			format(string,sizeof(string),"UnInvite: \t%s\n",YesOrNo(AdminInfo[playerid][aUnInvite]));
			strcat(allstr,string);
			format(string,sizeof(string),"MakeLeader: \t%s\n",YesOrNo(AdminInfo[playerid][aMakeLeader]));
			strcat(allstr,string);
			format(string,sizeof(string),"MakeAdmin: \t%s\n",YesOrNo(AdminInfo[playerid][aMakeAdmin]));
			strcat(allstr,string);
			format(string,sizeof(string),"MakeHelper: \t%s\n",YesOrNo(AdminInfo[playerid][aMakeHelper]));
			strcat(allstr,string);
			format(string,sizeof(string),"OOC: \t\t%s\n",YesOrNo(AdminInfo[playerid][aOOC]));
			strcat(allstr,string);
			format(string,sizeof(string),"SetCarPrice: \t%s\n",YesOrNo(AdminInfo[playerid][aSetCarPrice]));
			strcat(allstr,string);
			format(string,sizeof(string),"GiveMoney: \t%s\n",YesOrNo(AdminInfo[playerid][aGiveMoney]));
			strcat(allstr,string);
			format(string,sizeof(string),"AdminOOC: \t%s\n",YesOrNo(AdminInfo[playerid][aAdminOOC]));
			strcat(allstr,string);
			format(string,sizeof(string),"SetSkin: \t%s\n",YesOrNo(AdminInfo[playerid][aSetSkin]));
			strcat(allstr,string);
			format(string,sizeof(string),"FixVeh: \t%s\n",YesOrNo(AdminInfo[playerid][aFixVeh]));
			strcat(allstr,string);
			format(string,sizeof(string),"FuelVeh: \t%s\n",YesOrNo(AdminInfo[playerid][aFuelVeh]));
			strcat(allstr,string);
			format(string,sizeof(string),"Answer: \t%s\n",YesOrNo(AdminInfo[playerid][aAnswer]));
			strcat(allstr,string);
			format(string,sizeof(string),"Veh: \t\t%s\n",YesOrNo(AdminInfo[playerid][aVeh]));
			strcat(allstr,string);
			format(string,sizeof(string),"Jail: \t\t%s",YesOrNo(AdminInfo[playerid][aJail]));
			strcat(allstr,string);
			ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Администраторские возможности",allstr,"Ок","");
		}
	}
	return true;
}

COMMAND:unban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new name[24],string[200];
	    if(sscanf(params,"s[24]",name)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unban [name]");
	    if(IsBannedName(name))
	    {
	        mysql_real_escape_string(name, UnbanName[playerid]);
	        new day, month, year, seconds, minutes, hours, reason[100], admin[24], result[300], Name[24];
		    format(string, sizeof(string), "SELECT * FROM `BanNames` WHERE `Name` = '%s' LIMIT 1", UnbanName[playerid]);
			mysql_query(string);
			mysql_store_result();
			if(mysql_num_rows() == 1)
			{
				mysql_fetch_row(result, "|");
				sscanf(result,"p<|>s[24]s[24]s[100]dddddd",
				Name,
				admin,
				reason,
				seconds,
				minutes,
				hours,
				day,
				month,
				year);
			}
		    format(string,sizeof(string),"{FFFFFF}\
			Блокиратор: %s\n\
			Причина: %s\n\
			Дата блокировки: %02d.%02d.%02d | %02d:%02d:%02d",
			admin,
			reason,
			day,
			month,
			year,
			hours,
			minutes,
			seconds);
			ShowPlayerDialogEx(playerid,91,0,"Информация о забаненном",string,"Разбанить","Отмена");
			mysql_free_result();
	    }
	    else
	    {
	        SendClientMessage(playerid, -1, "Этот игрок не забанен");
	    }
	}
	return true;
}

COMMAND:unbanip(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new IP[24],string[200];
	    if(sscanf(params,"s[20]",IP)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unbanip [IP]");
	    format(string,sizeof(string),"BanIP/%s.ini",IP);
	    if(fexist(string))
	    {
         	fremove(string);
	        SendClientMessage(playerid, COLOR_YELLOW, "IP разбанен");
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Этот IP не забанен");
	    }
	}
	return true;
}

COMMAND:bannedip(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new IP[24],string[200];
	    if(sscanf(params,"s[24]",IP)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /bannedip [IP]");
	    format(string,sizeof(string),"BanIP/%s.ini",IP);
	    if(!fexist(string))
	    {
         	BanIP(IP);
	        SendClientMessage(playerid, COLOR_YELLOW, "IP забанен");
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Этот IP уже забанен");
	    }
	}
	return true;
}

COMMAND:bannedname(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new name[24],reason[100];
	    if(sscanf(params,"s[24]s[128]",name,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /bannedname [name] [причина]");
		if(GetString(name, "Jensen_Ackles")) return SendClientMessage(playerid, COLOR_GREY, "Нельзя забанить гл. администратора");
		if(!IsBannedName(name))
	    {
         	BanName(name,reason,PN(playerid));
	        SendClientMessage(playerid, COLOR_YELLOW, "Игрок забанен");
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Этот Игрок уже забанен");
	    }
	}
	return true;
}


COMMAND:banstats(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new name[24],string[200];
	    if(sscanf(params,"s[24]",name)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /banstats [name]");
	    if(IsBannedName(name))
	    {
	        new day, month, year, seconds, minutes, hours, reason[100], admin[24], result[300], Name[24];
		    format(string, sizeof(string), "SELECT * FROM `BanNames` WHERE `Name` = '%s' LIMIT 1", name);
			mysql_query(string);
			mysql_store_result();
			if(mysql_num_rows() == 1)
			{
				mysql_fetch_row(result, "|");
				sscanf(result,"p<|>s[24]s[24]s[100]dddddd",
				Name,
				admin,
				reason,
				seconds,
				minutes,
				hours,
				day,
				month,
				year);
			}
		    format(string,sizeof(string),"{FFFFFF}\
			Блокиратор: %s\n\
			Причина: %s\n\
			Дата блокировки: %02d.%02d.%02d | %02d:%02d:%02d",
			admin,
			reason,
			day,
			month,
			year,
			hours,
			minutes,
			seconds);
			ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Информация о забаненном",string,"Ок","");
			mysql_free_result();
	    }
	}
	return true;
}

COMMAND:unarrest(playerid, params[])
{
	if(IsACop(playerid))
	{
	    new id,string[200];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unarrest [id]");
	    if(PlayerInfo[playerid][pRank] >= 10 || ArrestID[id] == playerid)
	    {
		    if(ProxDetectorS(3,playerid,id))
		    {
		        if(PlayerInfo[id][pJailTime] > 0)
		        {
		            format(string,sizeof(string),"Законник %s выпустил вас из тюрьмы",cPN(playerid));
					SendClientMessage(id,COLOR_LIGHTBLUE,string);
					format(string,sizeof(string),"Вы выпустили игрока %s из тюрьмы",cPN(id));
					SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
					format(string,sizeof(string),"* Законник %s выпустил игрока %s из тюрьмы",cPN(playerid),PN(id));
					ProxDetector(10,playerid,string,COLOR_PURPLE);
		            SetPlayerInterior(id, 6);
				    SetPlayerVirtualWorld(id, 1);
					J_SetPlayerPos(id,246.2579,69.8768,1003.6406);
					PlayerInfo[id][pJailed] = 0;
					PlayerInfo[id][pJailTime] = 0;
					PlayerInfo[id][pBailPrice] = 0;
					new org = GetTeamID(id);
					SetCameraBehindPlayerEx(id);
					PlayerInfo[id][pSkin] = GetSkinOfPlayer(id);
					SetPlayerSkin(playerid,PlayerInfo[id][pSkin]);
					ResetSpawnInfo(id, org);
					SaveAccount(playerid);
					SaveAccount(id);
				}
				else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в тюрьме");
			}
			else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Ваш ранг слишком мал. Вы можете выпускать только посаженных вами игроков.");
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы не законник");
	return true;
}

COMMAND:bizinfo(playerid, params[])
{
	if(PlayerInfo[playerid][pBizKey] != -1)
	{
	    new string[300],str[50],lock[15];
	    new biz = PlayerInfo[playerid][pBizKey];
	    if(BizInfo[biz][bLock]) lock = "{FF6347}Закрыт";
		else lock = "{9ACD32}Открыт";
	    if(!IsNoEnterBiz(biz) || BizInfo[biz][bState] == B_GAS || BizInfo[biz][bState] == B_RENTCAR)
	    {
	        new Text[30];
	        switch(BizInfo[biz][bState])
			{
			    case B_GAS: Text = "Стоимость 1л";
			    case B_RENTCAR: Text = "Стоимость аренды";
			    default: Text = "Стоимость входа";
	        }
		    format(str,sizeof(str),"{FFFFFF}%s: {9ACD32}$%.1f\n",Text,BizInfo[biz][bEnterPrice]);
		    strcat(string,str);
		}
		if(BizInfo[biz][bState] == B_GAS)
		{
		    format(str,sizeof(str),"{FFFFFF}Стоимость топлива: {9ACD32}$%.0f\n",BizInfo[biz][bProdPrice]);
		    strcat(string,str);
		    format(str,sizeof(str),"{FFFFFF}Всего топлива: {9ACD32}%d\n",BizInfo[biz][bProducts]);
		    strcat(string,str);
		}
		else if(BizInfo[biz][bState] == B_GUNSHOP)
		{
		    format(str,sizeof(str),"{FFFFFF}Стоимость материалов: {9ACD32}$%.0f\n",BizInfo[biz][bProdPrice]);
		    strcat(string,str);
		    format(str,sizeof(str),"{FFFFFF}Всего материалов: {9ACD32}%d\n",BizInfo[biz][bProducts]);
		    strcat(string,str);
		}
  		format(str,sizeof(str),"{FFFFFF}Банк бизнеса: {9ACD32}$%d\n",BizInfo[biz][bMoney]);
  		strcat(string,str);
  		format(str,sizeof(str),"{FFFFFF}Уровень: {9ACD32}%d\n",BizInfo[biz][bLevel]);
  		strcat(string,str);
  		format(str,sizeof(str),"{FFFFFF}Открыт/Закрыт: %s",lock);
  		strcat(string,str);
  		if(!ShowPlayerDialogEx(playerid,156,0,BizInfo[biz][bName],string,"Изменить","Отмена"))
  		{
  		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
  		}
	}
	return true;
}

COMMAND:virmoney(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,money,string[200];
	    if(sscanf(params,"ud",id,money)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /virmoney [id] [money]");
	    if(IsPlayerConnected(id))
	    {
			PlayerInfo[id][pVirMoney] += money;
			if(money > 0)
			{
				PlayerInfo[id][pOldRepl] = money;
				PlayerInfo[id][pAllRepl] += money;
			}
			format(string,sizeof(string),"Вы успешно пополнили счет игрока %s(ID: %i) на %d рублей",PN(id),id,money);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			if(money > 0)
			{
				format(string,sizeof(string),"** Администратор %s пополнил ваш Donate-счет на %d рублей",PN(playerid),money);
				SendClientMessage(id,COLOR_LIGHTBLUE,string);
			}
			SaveAccount(id);
	    }
	}
	return true;
}

COMMAND:unajail(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aJail]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unajail [id]");
	    if(PlayerInfo[id][pJailTime] > 0)
	    {
	        PlayerInfo[id][pJailTime] = 0;
	        PlayerInfo[id][pJailed] = 0;
	        PlayerInfo[id][pBailPrice] = 0;
	        SetPlayerFacingAngle(playerid, 0);
			J_SetPlayerPos(id, -1445.0875,475.8321,3811.0415);
			ResetSpawnInfo(id, GetTeamID(id));
			format(string,sizeof(string),"** Админ %s выпустил вас из тюрьмы",PN(playerid));
			SendClientMessage(id,COLOR_LIGHTBLUE,string);
			format(string,sizeof(string),"Вы выпустили игрока %s из тюрьмы",PN(id));
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		}
	}
	return true;
}

COMMAND:ajail(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aJail]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200],reason[100],time;
	    if(sscanf(params,"uds[100]",id,time,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /ajail [id] [time] [reason]");
		PlayerPlaySound(id, 1058, 0.0, 0.0, 0.0);
		PlayerInfo[id][pJailed] = 1;
 		PlayerInfo[id][pJailTime] = time*60;
 		PlayerInfo[id][pWanted] = 0;
 		PlayerInfo[id][pBailPrice] = 0;
		SetPlayerWantedLevel(id, 0);
		CreatePlayerFindZone(id);
		J_TogglePlayerControllable(id, true);
		SetSpawnInfo(id, 255, 8, JailPos[0][0], JailPos[0][1], JailPos[0][2], 90.0, 0, 0, 0, 0, 0, 0);
		format(string, sizeof(string), "[Prison] Вы были посаженны в тюрьму на %d минут. Причина: %s",time,reason);
		SendClientMessage(id, COLOR_LIGHTRED, string);
		format(string, sizeof(string), "** Админ %s посадил игрока %s на %d минут. Причина: %s",PN(playerid),PN(id),time,reason);
		SendClientMessageToAll(COLOR_LIGHTRED, string);
		PlayerSpawn(id);
	}
	return true;
}

COMMAND:dmjail(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /dmjail [id]");
		PlayerPlaySound(id, 1058, 0.0, 0.0, 0.0);
		PlayerInfo[id][pJailed] = 1;
 		PlayerInfo[id][pJailTime] = 300;
 		PlayerInfo[id][pWanted] = 0;
 		PlayerInfo[id][pBailPrice] = 0;
		SetPlayerWantedLevel(id,0);
		CreatePlayerFindZone(id);
		J_TogglePlayerControllable(id,true);
		SetSpawnInfo(id, 255, 8, JailPos[0][0], JailPos[0][1], JailPos[0][2], 90.0, 0, 0, 0, 0, 0, 0);
		SendClientMessage(id, COLOR_LIGHTRED, "[Prison] Вы были посаженны в тюрьму на 5 минут. Причина: ДМ");
		format(string, sizeof(string), "** Админ %s посадил игрока %s на 5 минут. Причина: ДМ",PN(playerid),PN(id));
		SendClientMessageToAll(COLOR_LIGHTRED, string);
		PlayerSpawn(id);
	}
	return true;
}

COMMAND:take(playerid, params[])
{
	if(IsACop(playerid) || GetTeamID(playerid) == TEAM_LICENSERS)
	{
	    new id, rank = PlayerInfo[playerid][pRank];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /take [id]");
	    if(ProxDetectorS(2.0,playerid,id) || (GetTeamID(playerid) == TEAM_LICENSERS && rank >= 2))
	    {
	        TakeOffer[playerid] = id;
	        if(IsACop(playerid)) ShowPlayerDialogEx(playerid,88,2,"Что забрать","Наркотики\nМатериалы\nОружие\nЛицензию","Забрать","Отмена");
			else if(GetTeamID(playerid) == TEAM_LICENSERS) ShowPlayerDialogEx(playerid,89,2,"Что забрать","Лицензию на авто\nЛицензию на мото\nЛицензию на полеты\nЛицензию на ловлю рыбы\nЛицензию на плавание\nЛицензию на оружие","Забрать","Отмена");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока или ваш ранг слишком мал");
	}
	return true;
}

COMMAND:putplayer(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,car,seat;
	    if(sscanf(params,"udd",id,car,seat)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /putplayer [id] [carid] [seat]");
		J_PutPlayerInVehicle(id,car,seat);
	}
	return true;
}

COMMAND:incar(playerid, params[])
{
	new id,mesto,string[200];
	if(sscanf(params,"ud",id,mesto) || mesto < 1 || mesto > 3) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /incar [id] [id места(1-3)]");
	if(!ProxDetectorS(2,playerid,id)) return SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	new tied = (Knockout[id] && KnockoutTick[id] == 0);
	new imcop = IsACop(playerid);
	new cuffed = (imcop && Cuffed[id]);
	if( !tied && !cuffed ) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не обездвижен");
	for(new i = 1;i < ADD_VEHICLES;i ++)
	{
		if(!IsACar(i)) continue;
		if(GetDoorsStatus(i)) continue;
		if(GetVehicleSeat(i, mesto) != INVALID_PLAYER_ID) continue;
		if( mesto > GetVehicleMaxSeat(i) ) continue;
		if( !( IsACopCar(i) && imcop ) && !tied ) continue;
		new Float:X,Float:Y,Float:Z;
		GetVehiclePos(i,X,Y,Z);
		if(!IsPlayerInRangeOfPoint(playerid,2.5,X,Y,Z)) continue;
		J_PutPlayerInVehicle(id, i, mesto);
		J_TogglePlayerControllable(id, false);
		format(string,sizeof(string),"* %s затащил игрока %s в машину.",cPN(playerid),cPN(id));
		ProxDetector(15,playerid,string,COLOR_PURPLE);
		break;
	}
	return true;
}

COMMAND:cc(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] > ADM_NONE)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		ClearChatToAll();
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Чат очищен");
	}
	return true;
}

COMMAND:cckk(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		for(new i;i < 5;i ++) SendDeathMessage(playerid, 500, 500);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Киллист очищен");
	}
	return true;
}

COMMAND:arrest(playerid, params[])
{
	if(IsACop(playerid))
	{
	    new Float:Distance[sizeof(PrisonPos)];
	    Distance[0] = GetPlayerDistanceFromPoint(playerid,PrisonPos[0][0],PrisonPos[0][1],PrisonPos[0][2]);
	    Distance[1] = GetPlayerDistanceFromPoint(playerid,PrisonPos[1][0],PrisonPos[1][1],PrisonPos[1][2]);
	    Distance[2] = GetPlayerDistanceFromPoint(playerid,PrisonPos[2][0],PrisonPos[2][1],PrisonPos[2][2]);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Едьте на место обозначенное на карте красным маркером");
	    TogglePlayerDynamicCP(playerid,JailCP[0],false);
	    TogglePlayerDynamicCP(playerid,JailCP[1],false);
	    TogglePlayerDynamicCP(playerid,JailCP[2],false);
	    if(Distance[0] < Distance[1] && Distance[0] < Distance[2])
	    {
	        PlayerJailCP[playerid] = 0;
	        TogglePlayerDynamicCP(playerid,JailCP[0],true);
	    }
	    else if(Distance[1] < Distance[0] && Distance[1] < Distance[2])
	    {
	        PlayerJailCP[playerid] = 1;
	        TogglePlayerDynamicCP(playerid,JailCP[1],true);
	    }
	    else if(Distance[2] < Distance[0] && Distance[2] < Distance[1])
	    {
	        PlayerJailCP[playerid] = 2;
	        TogglePlayerDynamicCP(playerid,JailCP[2],true);
	    }
	}
	return true;
}

COMMAND:unleader(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new str[70], string[1500];
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_LSPD),OrgInfo[TEAM_LSPD][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_LVPD),OrgInfo[TEAM_LVPD][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t\t{9ACD32}%s\n",TeamName(TEAM_FBI),OrgInfo[TEAM_FBI][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_SWAT),OrgInfo[TEAM_SWAT][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_M4C),OrgInfo[TEAM_M4C][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_MERIALS),OrgInfo[TEAM_MERIALS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_MERIASF),OrgInfo[TEAM_MERIASF][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_MERIALV),OrgInfo[TEAM_MERIALV][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_LICENSERS),OrgInfo[TEAM_LICENSERS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_RADIO),OrgInfo[TEAM_RADIO][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_RACERS),OrgInfo[TEAM_RACERS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_GROOVE),OrgInfo[TEAM_GROOVE][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_VAGOS),OrgInfo[TEAM_VAGOS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_BALLAS),OrgInfo[TEAM_BALLAS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_CORONOS),OrgInfo[TEAM_CORONOS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_RIFA),OrgInfo[TEAM_RIFA][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_RM),OrgInfo[TEAM_RM][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_YAKUZA),OrgInfo[TEAM_YAKUZA][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_LCN),OrgInfo[TEAM_LCN][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_TRIADS),OrgInfo[TEAM_TRIADS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_UM),OrgInfo[TEAM_UM][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t\t{9ACD32}%s\n",	TeamName(TEAM_BIKERS),OrgInfo[TEAM_BIKERS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s\n",	TeamName(TEAM_CRIPS),OrgInfo[TEAM_CRIPS][oLeader]);
		strcat(string,str);
		format(str,sizeof(str),"{FFFFFF}%s: \t{9ACD32}%s",		TeamName(TEAM_MS13),OrgInfo[TEAM_MS13][oLeader]);
		strcat(string,str);
		ShowPlayerDialogEx(playerid,115,2,"Снять с лидерства",string,"Снять","Отмена");
	}
	return true;
}

COMMAND:expgate(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		if(IsValidObject(gGate[7]))
		{
		    new Float:X,Float:Y,Float:Z;
		    GetObjectPos(gGate[7],X,Y,Z);
		    CreateExplosion(X, Y, Z, 2, 0.0);
		    DestroyObject(gGate[7]);
		}
	}
	return true;
}

COMMAND:unexpgate(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!IsValidObject(gGate[7]))
		{
		    gGate[7] = CreateObject(GateInfo[7][gObID],GateInfo[7][gClose_X],GateInfo[7][gClose_Y],GateInfo[7][gClose_Z],0,0,GateInfo[7][gClose_A]);
			return true;
		}
	}
	return true;
}

COMMAND:buylotto(playerid, params[])
{
	if(GetMoney(playerid) >= 15)
	{
	    new string[100],bilet;
	    if(sscanf(params,"d",bilet)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /buylotto [1-100]");
		if(bilet >= 1 && bilet <= 100)
		{
		    format(string,sizeof(string),"Вы купили билет с номером %d (-$15)",bilet);
		    SendClientMessage(playerid,COLOR_LIGHTBLUE, string);
		    PlayerInfo[playerid][pLotto] = bilet;
		    GiveMoney(playerid,-15,"lotto");
	    }
	}
	return true;
}


public ChangeInterior(playerid)
{
	new string[30];
	if(CreateHouse[playerid][chInt] == 1 || BuyInt[playerid] == 1)
	{
	    SetPlayerInterior(playerid,IntInfo[1][iInterior]);
		SetPlayerCameraPos(playerid,IntInfo[1][iCam_X],IntInfo[1][iCam_Y],IntInfo[1][iCam_Z]); //
		SetPlayerCameraLookAt(playerid,IntInfo[1][iCamAt_X],IntInfo[1][iCamAt_Y],IntInfo[1][iCamAt_Z]); //
		format(string,sizeof(string),"Level: %d~n~Cost: $%d",IntInfo[1][iLevel],IntInfo[1][iCost]);
		PlayerTextDrawSetString(playerid, InfoText[playerid],string);
		PlayerTextDrawShow(playerid,InfoText[playerid]);
		TextDrawShowForPlayer(playerid,ButtonRight);
		TextDrawShowForPlayer(playerid,ButtonCancel);
		TextDrawShowForPlayer(playerid,ButtonSelect);
		StopUseTelephone(playerid, 0);
		SelectTextDraw(playerid, 0xFFFFFFFF);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Чтобы посмотреть следующий интерьер введите /next или нажмите {9ACD32}>");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Чтобы посмотреть предыдущий интерьер введите /back или нажмите {9ACD32}<");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Чтобы выбрать интерьер введите /done или нажмите {9ACD32}Select");
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Для отмены нажмите {9ACD32}Cancel");
	}
	return true;
}

COMMAND:teamcar(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0 && (IsAtGang(playerid) || IsAtMafia(playerid)))
	{
	    if(IsAtSpawn(playerid))
	    {
		    BuyingCar[playerid] = 0;
		    BuyingModel[playerid] = 0;
	    	J_TogglePlayerSpectating(playerid, true);
	    	SendClientMessage(playerid, 0xFFFFFFFF, "Подождите немного ...");
			SetTimerEx("BuyTeamCar", 1000, false, "i", playerid);
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы должны быть возле спавна");
	}
	return true;
}

COMMAND:addhouse(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
		new Float:X, Float:Y, Float:Z;
		GetPlayerPos(playerid, X, Y, Z);
		CreateHouse[playerid][chEnter_X] = X;
		CreateHouse[playerid][chEnter_Y] = Y;
		CreateHouse[playerid][chEnter_Z] = Z;
		CreateHouse[playerid][chInt] = 1;
		J_TogglePlayerSpectating(playerid,true);
  		SendClientMessage(playerid, 0xFFFFFFFF, "Подождите немного ...");
  		SetTimerEx("ChangeInterior", 1000, false, "i", playerid);
	}
	return true;
}

COMMAND:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid])
	    {
	        /*
	        if(GetString(PlayerAdmPass[playerid],"No Admin Pass"))
	        {
				ShowPlayerDialogEx(playerid,210,1,"Регистрация","\
				{AFAFAF}Вы ещё не указывали админ-пароль\n\n\
				{33CCFF}Придумайте себе админ-пароль\n\
			 	{9ACD32}- Он нужен для доступа к админ-командам","Ок","Отмена");
			}
			else
			{
			    ShowPlayerDialogEx(playerid,211,1,"Авторизация","{FFFFFF}Введите ваш админ-пароль","Ок","Отмена");
			}
	        */
	        ShowPlayerDialogEx(playerid,211,1,"Авторизация","{FFFFFF}Введите админ-пароль","Ок","Отмена");
	    }
	    else
	    {  
	        new string[100],Admin[20];
	        switch(PlayerInfo[playerid][pAdmin])
	        {
	            case ADM_MODER: Admin = "Модератор";
	            case ADM_SUPER_MODER: Admin = "Ст.Модератор";
	            case ADM_ADMIN: Admin = "Администратор";
	            case ADM_SUPER_ADMIN: Admin = "Ст.Администратор";
	            case ADM_GRAND_ADMIN: Admin = "Гл.Администратор";
	        }
		    format(string,sizeof(string),"** %s %s ушел с дежурства",Admin,PN(playerid));
		    SendAdminsMessage(COLOR_YELLOW, string, 1);
	        SendClientMessage(playerid,COLOR_GREY,"Вы ушли с дежурства админа");
	        ADuty[playerid] = false;
	    }
	}
	return true;
}

COMMAND:hduty(playerid, params[])
{
	if(PlayerInfo[playerid][pHelper] > 0)
	{
	    new string[128];
	    if(!HDuty[playerid])
	    {
		    format(string,sizeof(string),"(( Хелпер %s ждет ваши вопросы {9ACD32}[/ask]{FFFFFF} ))",PN(playerid));
		    SendClientMessageToAll(COLOR_WHITE, string);
		    SendClientMessage(playerid,COLOR_LIME,"Вы вышли на дежурство хелпера");
		    HDuty[playerid] = true;
	    }
	    else
	    {
	        format(string,sizeof(string),"(( Хелпер %s ушел с дежурства ))",PN(playerid));
		    SendClientMessageToAll(COLOR_WHITE, string);
	        SendClientMessage(playerid,COLOR_GREY,"Вы ушли с дежурства хелпера");
	        HDuty[playerid] = false;
	    }
	}
	return true;
}

COMMAND:engine(playerid, params[])
{
	if(GetPlayerState(playerid) == 2)
	{
		new carid = GetPlayerVehicleID(playerid);
		if(!IsAVelik(carid) && !IsAMPCar(carid))
		{
			if(GetEngineStatus(carid) < 1)
			{
			    if(!Filled[carid])
			    {
				    if(IsAArendCar(carid))
				    {
				        new rentid = GetArendCarID(carid);
				        if(ArendInfo[rentid][aRentID] != playerid) return false;
				    }
				    if(RepairOffer[playerid] != INVALID_PLAYER_ID) return false;
				    if(IsACar(carid) && !PlayerInfo[playerid][pCarLic] && CarTest[playerid] == -1) return false;
				    if(IsABike(carid) && !PlayerInfo[playerid][pBikeLic]) return false;
				    if(IsAPlane(carid) && !PlayerInfo[playerid][pFlyLic]) return false;
				    if(IsABoat(carid) && !PlayerInfo[playerid][pBoatLic]) return false;
				    if(Fuel[carid] > 0.0)
				    {
					    if(!IsAOwnableCar(carid) || CarInfo[GetVehicleID(carid)][cKeyIN])
					    {
							if(!EngineTimer[playerid])
							{
							    new Float:Health, string[50];
							    GetVehicleHealth(carid, Health);
							    if(Health > 1000) Health = 1000.0;
							    else if(Health < 400)
							    {
									return SendClientMessage(playerid, COLOR_GREY, "Вы не можете завести двигатель. Для его починки вызовите механика");
							    }
							    new UNEngine = floatround(2000.0 - Health);
							    if(UNEngine < 0) UNEngine = 0;
							    else if(UNEngine > 2000) UNEngine = 2000;
							    SetTimerEx("EngineVehicle", UNEngine, false, "ii", playerid, carid);
							    format(string, sizeof(string), "* %s пытается завести двигатель", cPN(playerid));
							    ProxDetector(10.0, playerid, string, COLOR_PURPLE);
							}
							else
							{
							    SendClientMessage(playerid,COLOR_GREY,"Нельзя так часто заводить двигатель");
							    return false;
							}
					    }
					    else
					    {
					        SendClientMessage(playerid,COLOR_GREY,"Ключи не вставлены");
					        return false;
					    }
				    }
				    else
				    {
				        SendClientMessage(playerid,COLOR_GREY,"Нет топлива");
				        return false;
				    }
				}
				else
				{
				  	SendClientMessage(playerid,COLOR_GREY,"Вы заправляетесь");
				   	return false;
				}
			}
			else
			{
				new string[70];
				SetEngineStatus(carid,false);
				format(string,sizeof(string),"* Игрок %s заглушил двигатель",cPN(playerid));
				ProxDetector(20.0,playerid,string,COLOR_PURPLE);
				SpeedOFF(playerid, carid, 2);
			}
		}
	}
	return true;
}

COMMAND:setcarsprice(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aSetCarPrice]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new car,price,Cars,string[200];
	    if(sscanf(params,"dd",car,price)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setcarsprice [model] [price]");
		for(new c = 0;c < OWNABLECARS; c++)
		{
		    new number = OwnableCar[c];
			if(IsAOwnableCar(number))
			{
				if(GetVehicleModelEx(number) == car)
			    {
					CarInfo[c][cCost] = price;
					SetVehicleToRespawn(number);
					SaveOwnableCar(c);
					Cars ++;
				}
			}
		}
		format(string,sizeof(string),"Цена изменена на %d ТС",Cars);
		SendClientMessage(playerid,COLOR_WHITE,string);
	}
	return true;
}

COMMAND:phonelive(playerid, params[])
{
	if(GetTeamID(playerid) == TEAM_RADIO)
	{
		if(PlayerSayer[playerid] != INVALID_PLAYER_ID)
		{
		    if(LiveOffer[playerid] == INVALID_PLAYER_ID)
	    	{
	    	    new string[150];
	    	    format(string,sizeof(string),"Репортер %s предлагает вам провести с ним беседу в прямом эфире",PN(playerid));
	    	    if(ShowPlayerDialogEx(PlayerSayer[playerid],145,0,"Беседа",string,"Согласен","Ненадо"))
	    	    {
	    	    	LiveOfferID[PlayerSayer[playerid]] = playerid;
	    	    }
	    	    else SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	    	}
		}
	}
	return true;
}

COMMAND:live(playerid, params[])
{
	if(GetTeamID(playerid) == TEAM_RADIO)
	{
	    new carid = GetPlayerVehicleID(playerid);
		if(IsPlayerInAnyVehicle(playerid) && VehicleInfo[carid][vTeam] == TEAM_RADIO)
		{
		    if(LiveOffer[playerid] == INVALID_PLAYER_ID)
	    	{
	    	    new string[150],id;
	    	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY, "Используй: /live [id/name]");
	    	    if(IsPlayerConnected(id) && id != playerid)
	    	    {
	    	        if(IsPlayerInVehicle(id,GetPlayerVehicleID(playerid)))
					{
			    	    format(string,sizeof(string),"Репортер %s предлагает вам провести с ним беседу в прямом эфире",PN(playerid));
			    	    if(ShowPlayerDialogEx(id,146,0,"Беседа",string,"Согласен","Ненадо"))
			    	    {
			    	    	LiveOfferID[id] = playerid;
			    	    }
			    	    else
			    	    {
			    	        SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			    	    }
		    	    }
	    	    }
	    	}
		}
	}
	return true;
}

COMMAND:endlive(playerid, params[])
{
	if(GetTeamID(playerid) == TEAM_RADIO)
	{
	    new carid = GetPlayerVehicleID(playerid);
		if(IsPlayerInAnyVehicle(playerid) && VehicleInfo[carid][vTeam] == TEAM_RADIO)
		{
		    if(LiveOffer[playerid] != INVALID_PLAYER_ID)
	    	{
	    	    new id = LiveOffer[playerid];
	    	    new string[150];
	    	    if(IsPlayerConnected(id) && id != playerid)
	    	    {
	    	        J_TogglePlayerControllable(LiveOfferID[id], true);
	    	        format(string,sizeof(string),"[Radio]Репортер %s закончил беседу с %s.",PN(playerid), PN(LiveOfferID[id]));
					SendClientMessageToAll(COLOR_LIME, string);
	    	        format(string,sizeof(string),"Репортер %s закончил беседу с вами.",PN(playerid));
					SendClientMessage(id, COLOR_GREY, string);
					format(string,sizeof(string),"Вы закончили беседу с %s.",PN(playerid));
					SendClientMessage(playerid, COLOR_GREY, string);
			    	LiveOfferID[id] = INVALID_PLAYER_ID;
	    	    }
	    	    J_TogglePlayerControllable(playerid, true);
	    	    LiveOfferID[playerid] = INVALID_PLAYER_ID;
	    	}
		}
	}
	return true;
}

COMMAND:zeks(playerid, params[])
{
	if(IsACop(playerid))
	{
		new string[100];
		for(new i = 0;i < GetMaxPlayersEx(); i ++)
		{
			if(IsPlayerConnected(i))
			{
				if(PlayerInfo[i][pJailTime] > 0)
				{
					format(string,sizeof(string),"%s(%i) | Время: %d мин | Залог: $%d",PN(i),i,PlayerInfo[i][pJailTime]/60,PlayerInfo[i][pBailPrice]);
					SendClientMessage(playerid,COLOR_GREY,string);
				}
			}
		}
	}
	return true;
}

COMMAND:wanted(playerid, params[])
{
	if(IsACop(playerid))
	{
		new string[100];
		for(new i = 0;i < GetMaxPlayersEx(); i ++)
		{
			if(IsPlayerConnected(i))
   			{
				if(PlayerInfo[i][pWanted] > 0)
			    {
					format(string,sizeof(string),"%s(%i) - %d-й уровень розыска",PN(i),i,PlayerInfo[i][pWanted]);
					SendClientMessage(playerid,COLOR_GREY,string);
    			}
			}
		}
	}
	return true;
}

COMMAND:cuff(playerid, params[])
{
	if(IsACop(playerid))
	{
	    if(!IsANotControllable(playerid))
		{
			new string[200], id;
			if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /cuff [id/name]");
			if(IsACop(id)) return SendClientMessage(playerid, COLOR_GREY, "Нельзя сковать законника");
			if(ProxDetectorS(1.5,playerid,id))
			{
				if(CuffedTime[id] > 0 || !PlayerSpeed(id))
				{
				    if(!Cuffed[id])
				    {
				        if(PlayerOfCuff[playerid] == INVALID_PLAYER_ID)
				        {
				            if(PlayerOfCuff[id] == INVALID_PLAYER_ID)
				        	{
						        PlayerOfCuff[playerid] = id;
						        PlayerOfCuff[id] = playerid;
						        TimeOfCuff[playerid] = 4;
						        format(string,sizeof(string),"* %s начинает сковывать игрока %s",cPN(playerid),cPN(id));
						        ProxDetector(15,playerid,string,COLOR_PURPLE);
						        ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.1, 0, 1, 1, 1, 0, 1);
							}
							else
					        {
					            SendClientMessage(playerid, COLOR_GREY, "Игрока уже сковывают");
					        }
				        }
				        else
				        {
				            SendClientMessage(playerid, COLOR_GREY, "Вы уже кого-то сковываете");
				        }
				    }
				    else
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Игрок уже скован");
				    }
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "Сначала нужно оглушить игрока");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_RED, "Вы не можете двигаться!");
		}
	}
	return true;
}

COMMAND:break(playerid, params[])
{
	if(PlayerInfo[playerid][pClip] > 0)
	{
		if(Cuffed[playerid])
		{
		    if(!CuffedTime[playerid])
		    {
		        CheckRobBank(playerid);
		        CheckTheftCar(playerid);
		        CheckMiner(playerid);
		        CheckRobPlayer(playerid);
		        CheckBreakCuff(playerid);
		        SetPlayerRandomKey(playerid, BreakKey[playerid], true);
		        ShowPlayerActionBand(playerid, 0, 10);
		    }
		    else
			{
			    SendClientMessage(playerid, COLOR_RED, "Вы парализованы!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Вы не скованы");
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "У вас нет скрепок");
	}
	return true;
}

COMMAND:uncuff(playerid, params[])
{
	if(IsACop(playerid))
	{
		new string[200], id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /uncuff [id/name]");
		if(ProxDetectorS(1.5,playerid,id))
		{
			if(Cuffed[id])
			{
				format(string,sizeof(string),"* %s расковал игрока %s",cPN(playerid),cPN(id));
				ProxDetector(15,playerid,string,COLOR_PURPLE);
				Cuffed[id] = false;
				J_TogglePlayerControllable(id,true);
				SetPlayerSpecialAction(id, 0);
				RemovePlayerAttachedObject(id, 0);
				if(GotoInfo[playerid][gtID] == id)
				{
					CheckPlayerGoCuff(playerid);
				}
			}
			else
			{
			    return SendClientMessage(playerid, -1, "Игрок не скован");
			}
		}
	}
	return true;
}

COMMAND:setvw(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aSetVW]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id,vw;
		if(sscanf(params,"ud",id,vw)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setvw [id/name] [world]");
		SetPlayerVirtualWorld(id,vw);
		return true;
	}
	return true;
}

COMMAND:freeze(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_MODER)
	{
	    if(!AdminInfo[playerid][aFreeze]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id,string[200];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /freeze [id/name]");
		if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN && PlayerInfo[id][pAdmin] > 0) return SendClientMessage(playerid, -1, "Нельзя заморозить администратора");
		format(string,sizeof(string),"** Админ %s заморозил игрока %s",PN(playerid),PN(id));
		SendAdminsMessage(COLOR_YELLOW,string,1);
		J_TogglePlayerControllable(id,false);
	}
	return true;
}

COMMAND:unfreeze(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id,string[200];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /unfreeze [id/name]");
		format(string,sizeof(string),"** Админ %s разморозил игрока %s",PN(playerid),PN(id));
		SendAdminsMessage(COLOR_YELLOW,string,1);
		J_TogglePlayerControllable(id,true);
	}
	return true;
}

COMMAND:service(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
	    if(!ShowPlayerDialogEx(playerid,166,2,"Выберите сервис","1. Такси\n2. Скорая помощь\n3. Механик","Выбор","Отмена"))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	    }
	}
	return true;
}

COMMAND:spawned(playerid, params[])
{
	if(!ShowPlayerDialogEx(playerid,173,2,"Выбор места спавна","\
	{FFFFFF}1. {AFAFAF}Улица\n\
	{FFFFFF}2. {6053F3}Дом\n\
	{FFFFFF}3. {9ACD32}Отель","Выбор","Отмена"))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:spawnchange(playerid, params[])
{
    return cmd_spawned(playerid,"");
}

COMMAND:pdd(playerid, params[])
{
	if(DrivingTest[playerid] == 0)
	{
	    PddState[playerid] = 0;
		SendClientMessage(playerid, COLOR_YELLOW, "|____ Параграф 1: Общие положения ____|");
  		SendClientMessage(playerid, COLOR_YELLOW, "1.1. Настоящие Правила дорожного движения устанавливают единый порядок дорожного движения на всей территории San Andreas.");
  		SendClientMessage(playerid, COLOR_YELLOW, " 1.2. Лица, нарушившие Правила, несут ответственность в соответствии с действующим законодательством.");
		ShowPlayerDialogEx(playerid, 51, 0, "Правила дорожного движения", "{FFFFFF}Используйте кнопки \"Далее\" или \"Выход\"", "Далее", "Выход");
	}
	else SendClientMessage(playerid, COLOR_GREY, "В данный момент вы сдаете тест на права.");
	return true;
}

COMMAND:clear(playerid, params[])
{
	if(IsACop(playerid))
	{
		new carid = GetPlayerVehicleID(playerid);
		if(carid != 0 && IsACopCar(carid))
		{
		    if(PlayerInfo[playerid][pRank] >= 4)
		    {
			    new id, string[300];
				if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /clear [id/name]");
				if(IsPlayerConnected(id))
				{
				    PlayerInfo[id][pWanted] = 0;
				    SetPlayerWantedLevel(id, 0);
				    CreatePlayerFindZone(id);
				    format(string,sizeof(string),"Законник %s очистил розыск игроку %s[%i]",PN(playerid), PN(id), id);
				    SendCopsMessage(COLOR_LIGHTBLUE,string);
				    format(string,sizeof(string),"Законник %s очистил ваш розыск",PN(playerid));
				    SendClientMessage(id,COLOR_LIGHTBLUE,string);
				    format(string,sizeof(string),"Вы очистили розыск игроку %s[%i]",PN(id), id);
				    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
				}
			}
			else
			{
	            SendClientMessage(playerid,COLOR_GREY,"Ваш ранг мал для этой операции. Необходим 4-й ранг.");
			}
		}
		else
		{
            SendClientMessage(playerid,COLOR_GREY,"Вы должны находится в полицейском транспорте.");
		}
	}
	return true;
}

stock GetPlayerTakeTest(playerid)
{
	for(new i; i < sizeof(TTPos); i ++)
	{
		if(IsPlayerInRangeOfPoint(playerid, 1.0, TTPos[i][0], TTPos[i][1], TTPos[i][2]))
		{
		    return i;
		}
	}
	return -1;
}
COMMAND:taketest(playerid, params[])
{
	if(!PlayerInfo[playerid][pCarLic])
	{
		if(DrivingTest[playerid] == 0 && CarTest[playerid] == -1)
		{
		    new pos = GetPlayerTakeTest(playerid);
			if(pos != -1)
			{
				if(!NeSdal[playerid])
				{
					if(GetMoney(playerid) >= 2000)
					{
					    SetPlayerPos(playerid, TTPos[pos][3], TTPos[pos][4], TTPos[pos][5]);
					    SetPlayerFacingAngle(playerid, TTPos[pos][6]);
						SetTimerEx("ApplySeatAnimation", 500, false, "i", playerid);
						GiveMoney(playerid,-2000,"TakeTest");
						OrgInfo[TEAM_LICENSERS][oBank] += 2000;
						SendClientMessage(playerid,COLOR_GREY,"Вы заплатили 2000 руб");
						ShowPlayerDialogEx(playerid,48,0,"Вступление","{FFFFFF}Вас приветствует школа вождения Г.Южный\nДля продолжения нажмите 'Далее'","Далее","Отмена");
						DrivingTest[playerid] = 1;
						Question[playerid] = 0;
						Errors[playerid] = 0;
						TestASKMassive[playerid] = { 0, 1, 2, 3 };
						RandomMassive(TestASKMassive[playerid], 4);
					}
					else SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег (2000 руб)");
				}
				else
				{
					if(GetMoney(playerid) >= 8000)
					{
					    SetPlayerPos(playerid, TTPos[pos][3], TTPos[pos][4], TTPos[pos][5]);
					    SetPlayerFacingAngle(playerid, TTPos[pos][6]);
						SetTimerEx("ApplySeatAnimation", 500, false, "i", playerid);
						GiveMoney(playerid,-8000,"ReTakeTest");
						OrgInfo[TEAM_LICENSERS][oBank] += 8000;
						SendClientMessage(playerid,COLOR_GREY,"Вы заплатили 8000 руб (Пересдача)");
						ShowPlayerDialogEx(playerid,48,0,"Вступление","{FFFFFF}Вас приветствует школа вождения Г.Южный\nДля продолжения нажмите 'Далее'","Далее","Отмена");
						DrivingTest[playerid] = 1;
						Question[playerid] = 0;
						Errors[playerid] = 0;
						TestASKMassive[playerid] = { 0, 1, 2, 3 };
						RandomMassive(TestASKMassive[playerid], 4);
					}
					else SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег (8000 руб)");
				}
			}
			else
			{
				SendClientMessage(playerid,COLOR_GREY,"Вы не возле компьютера");
			}
		}
	}
	else if(PlayerInfo[playerid][pCarLic] == 1)
	{
	    SendClientMessage(playerid,COLOR_GREY,"Ваша лицензия на авто обнулена. Теперь её можно получить только у лицензеров.");
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"У вас уже есть водительские права");
	}
	return true;
}

COMMAND:asellcar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aSellCar]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new car, string[300];
    	if(sscanf(params,"d",car)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /asellcar [carid]");
		if(IsAOwnableCar(car))
		{
			new number = GetVehicleID(car);
			new str[100],Name[24],Second,Minute,Hour,Day,Month,Year,IP[16],Time,result[300];
			format(string, sizeof(string), "SELECT * FROM `OnlineInfo` WHERE `Name` = '%s' LIMIT 1", CarInfo[number][cKeyer]);
			mysql_query(string);
			mysql_store_result();
			if(mysql_num_rows() == 1)
			{
				mysql_fetch_row(result, "|");
				sscanf(result,"p<|>s[24]s[16]ddddddd",
				Name,IP,Second,Minute,Hour,Day,Month,Year,Time);
				string = "{FFFFFF}";
	   			format(str,sizeof(str),"{FFFFFF}Ник: {33CCFF}%s\n",CarInfo[number][cKeyer]);
	   			strcat(string,str);
				format(str,sizeof(str),"{FFFFFF}Последнее посещение: {33CCFF}%d/%02d/%02d в %d:%02d\n",Day,Month,Year,Minute,Hour);
				strcat(string,str);
				format(str,sizeof(str),"{FFFFFF}Время пребывания: {33CCFF}%d минут(ы/у)\n",Time/60);
				strcat(string,str);
				if(PlayerInfo[playerid][pAdmin] > ADM_NONE)
				{
					format(str,sizeof(str),"{FFFFFF}IP адрес: {33CCFF}%s\n",IP);
					strcat(string,str);
				}
				ShowPlayerDialogEx(playerid,200,0,"Информация о владельце",string,"Продать","Отмена");
				aSellCarID[playerid] = car;
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Об этом игроке нет информации");
			    format(string,sizeof(string),"Вы продали авто №%d",car);
				SendClientMessage(playerid,COLOR_WHITE,string);
				SellCar(car);
			}
			mysql_free_result();
		}
	}
	return true;
}

COMMAND:acarpark(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        new carid = GetPlayerVehicleID(playerid);
	        new seat = GetPlayerVehicleSeat(playerid);
	        if(IsAOwnableCar(carid))
			{
			    new number = GetVehicleID(carid);
			    GetVehiclePos(carid,CarInfo[number][cPos_X],CarInfo[number][cPos_Y],CarInfo[number][cPos_Z]);
			    GetVehicleZAngle(carid,CarInfo[number][cPos_A]);
			    DestroyVehicleEx(carid);
			    OwnableCar[number] = J_AddStaticVehicleEx(CarInfo[number][cModel],CarInfo[number][cPos_X],CarInfo[number][cPos_Y],CarInfo[number][cPos_Z],CarInfo[number][cPos_A],CarInfo[number][cColor_1],CarInfo[number][cColor_2],100000);
			    J_PutPlayerInVehicle(playerid,carid,seat);
			    SendClientMessage(playerid, -1, "Транспорт припаркован");
			    SaveOwnableCar(number);
			}
	    }
	}
	return true;
}

COMMAND:makecar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeLeader]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, car, string[150];
    	if(sscanf(params,"ud",id,car)) return SendClientMessage(playerid,COLOR_ISPOLZUY, "Используй: /makecar [id/name] [carid]");
    	if(IsPlayerConnected(id))
    	{
    	    if(IsAOwnableCar(car))
    	    {
    	        if(IsValidNumberCars(id))
    	        {
		    	   	SetCarKeyer(car,PN(id));
		    	   	SetCarOwner(car,PN(id));
					GetNumberCars(id,PlayerInfo[id][pCars]);
					format(string,sizeof(string),"** Админ %s вручил вам ключи от авто №%d",PN(playerid),car);
					SendClientMessage(id,COLOR_YELLOW,string);
					format(string,sizeof(string),"Вы вручили игроку %s ключи от авто №%d",PN(id),car);
					SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
					SetVehicleToRespawn(car);
					SaveOwnableCar(GetVehicleID(car));
				}
				else SendClientMessage(playerid, COLOR_GREY, "Этому игроку нельзя т.к у него маленький лвл");
    	    }
		}
	}
	return true;
}

COMMAND:asellhouse(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aSellHouse]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new string[50],house;
	    if(sscanf(params,"d",house)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /asellhouse [houseid]");
		format(string,sizeof(string),"Вы продали дом №%d",house);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		SetString(HouseInfo[house][hOwner],"The State");
     	UpdateHouse(house);
	}
	return true;
}

COMMAND:asellhotel(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aSellHouse]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new string[50],hotel;
	    if(sscanf(params,"d",hotel)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /asellhotel [hotelid]");
		format(string,sizeof(string),"Вы продали отель №%d",hotel);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		SetString(HotelInfo[hotel][htOwner],"The State");
     	UpdateHotel(hotel);
	}
	return true;
}

COMMAND:makehouse(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeHouse]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, house, string[150];
    	if(sscanf(params,"ud",id,house)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /makehouse [id/name] [houseid]");
    	if(IsPlayerConnected(id))
    	{
			if(PlayerInfo[id][pHouseKey] != -1 && GetString(HouseInfo[house][hOwner],PN(id)))
			{
			    return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть дом");
			}
    	   	SetString(HouseInfo[house][hOwner],PN(id));
    	   	PlayerInfo[id][pHouseKey] = house;
			format(string,sizeof(string),"** Админ %s вручил вам ключи от дома №%d",PN(playerid),house);
			SendClientMessage(id,COLOR_YELLOW,string);
			format(string,sizeof(string),"Вы вручили игроку %s ключи от дома №%d",PN(id),house);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			UpdateHouse(house);
		}
	}
	return true;
}

COMMAND:makebiz(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeHouse]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, biz, string[150];
    	if(sscanf(params,"ud",id,biz)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /makebiz [id/name] [bizid]");
    	if(IsPlayerConnected(id))
    	{
			if(PlayerInfo[id][pBizKey] != -1 && GetString(BizInfo[biz][bOwner],PN(id)))
			{
			    return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть дом");
			}
    	   	SetString(BizInfo[biz][bOwner],PN(id));
    	   	PlayerInfo[id][pBizKey] = biz;
			format(string,sizeof(string),"** Админ %s вручил вам ключи от бизнеса №%d",PN(playerid),biz);
			SendClientMessage(id,COLOR_YELLOW,string);
			format(string,sizeof(string),"Вы вручили игроку %s ключи от бизнеса №%d",PN(id),biz);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			UpdateBiz(biz);
		}
	}
	return true;
}

COMMAND:fixveh(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!AdminInfo[playerid][aFixVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		if(IsPlayerInAnyVehicle(playerid))
		{
		    return J_RepairVehicle(GetPlayerVehicleID(playerid));
		}
	}
	return true;
}

COMMAND:fuelveh(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!AdminInfo[playerid][aFuelVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		if(IsPlayerInAnyVehicle(playerid))
		{
		    return J_RefillVehicle(GetPlayerVehicleID(playerid));
		}
	}
	return true;
}


COMMAND:fuelcars(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!AdminInfo[playerid][aFuelVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		for(new i = 1;i < ADD_VEHICLES;i ++)
		{
		    J_RefillVehicle(i);
		}
	}
	return true;
}

COMMAND:setskin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!AdminInfo[playerid][aSetSkin]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,skin,string[150];
	    if(sscanf(params,"ud",id,skin)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setskin [id/name] [skinid (0 - 300)]");
	    if(IsPlayerConnected(id))
	    {
	        if(skin >= 0 && skin < 300)
	        {
		    	SetPlayerSkin(id,skin);
		    	format(string,sizeof(string),"Вы дали игроку %s скин %d",PN(id),skin);
		    	SendClientMessage(playerid,-1,string);
		    	PlayerInfo[id][pSkin] = skin;
	    	}
	    }
    }
    return true;
}

COMMAND:numcars(playerid, params[])
{
    new str[50];
	GetNumberCars(playerid,PlayerInfo[playerid][pCars]);
	format(str,sizeof(str),"Вы имеете: %d ТС",PlayerInfo[playerid][pCars]);
	SendClientMessage(playerid,-1,str);
}

COMMAND:showcars(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new Car,string[200],id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /showcars [id/name]");
		for(new c = 0;c < OWNABLECARS;c++)
		{
		    new number = OwnableCar[c];
			if(IsPlayerHaveCar(id,number))
			{
				Car ++;
				if(Car == 1) SendClientMessage(playerid,COLOR_GREY,"________________________________Мой транспорт_______________________________");
				new Loked[10];
				if(CarInfo[c][cLock] >= 1) Loked = "Закрыт";
				else Loked = "Открыт";
				new CarPound[12];
				if(CarInfo[c][cShtraf] > 0) CarPound = "{FF6347}[X]";
				format(string,sizeof(string),"[%d] Модель: [%s] Номер: [%s] Стоимость: [%d] Статус блокировки: [%s] %s",Car,GetVehicleName(GetVehicleModelEx(number)),OwnCarNumber(number),CarInfo[c][cCost],Loked,CarPound);
				SendClientMessage(playerid,COLOR_WHITE,string);
			}
		}
		format(string,sizeof(string),"Он(а) имеет %d ТС",Car);
		SendClientMessage(playerid,COLOR_GREY,string);
		if(Car > 0) SendClientMessage(playerid,COLOR_GREY,"____________________________________________________________________________");
	}
	return true;
}

COMMAND:cvetoff(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    J_SetPlayerColor(playerid, 0xFFFFFF00);
	    SetPlayerColor(playerid, 0xFFFFFF00);
	}
	return true;
}

COMMAND:givemoney(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aGiveMoney]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,money,string[150];
	    if(sscanf(params,"ud",id,money)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /givemoney [id/name] [money]");
	    if(IsPlayerConnected(id))
	    {
	    	GiveMoney(id,money,"GiveMoney(adm)");
	    	format(string,sizeof(string),"Вы дали игроку %s $%d",PN(id),money);
	    	SendClientMessage(playerid,-1,string);
	    	SaveAccount(id);
	    }
    }
	return true;
}

COMMAND:money(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aGiveMoney]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,money,string[150];
	    if(sscanf(params,"ud",id,money)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /money [id/name] [money]");
	    if(IsPlayerConnected(id))
	    {
	        ResetPlayerMoney(id);
	        PlayerInfo[id][pMoney] = 0;
	    	GiveMoney(id,money,"Money (adm)");
	    	format(string,sizeof(string),"Вы дали игроку %s $%d",PN(id),money);
	    	SendClientMessage(playerid,-1,string);
	    	SaveAccount(id);
	    }
    }
	return true;
}

COMMAND:han(playerid, params[])
{
    if(PlayerInfo[playerid][pHelper] > 0 && HDuty[playerid])
	{
	    new id,result[150],string[200],drank[20];
	    if(sscanf(params,"us[150]",id,result)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /han [id/name] [answer]");
	    if(IsPlayerConnected(id))
	    {
			if(PlayerInfo[playerid][pHelper] == 1) drank = "Мл. Хелпер";
	    	else if(PlayerInfo[playerid][pHelper] == 2) drank = "Хелпер";
	    	else if(PlayerInfo[playerid][pHelper] == 3) drank = "Гл. Хелпер";
	    	format(string,sizeof(string),"Вам ответил %s %s: %s",drank,PN(playerid),result);
	        SendClientMessage(id,COLOR_LIGHTRED,string);
	        format(string,sizeof(string),"%s %s ответил игроку %s: %s",drank,PN(playerid),PN(id),result);
	        SendHelpersMessage(COLOR_YELLOW,string,true);
	    }
    }
    return true;
}

COMMAND:an(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aAnswer]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,result[150],string[200],drank[20];
	    if(sscanf(params,"us[150]",id,result)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /an [id/name] [answer]");
	    if(IsPlayerConnected(id))
	    {
	        switch(PlayerInfo[playerid][pAdmin])
	        {
	            case ADM_MODER: drank = "Модератор";
	            case ADM_SUPER_MODER: drank = "Ст. Модератор";
	            case ADM_ADMIN: drank = "Администратор";
	            case ADM_SUPER_ADMIN: drank = "Ст. Администратор";
	            case ADM_GRAND_ADMIN: drank = "Гл. Администратор";
	        }
	    	format(string,sizeof(string),"** Вам ответил админ %s: %s",PN(playerid),result);
	        SendClientMessage(id,COLOR_LIGHTRED,string);
	        format(string,sizeof(string),"** %s %s ответил игроку %s: %s",drank,PN(playerid),PN(id),result);
	        SendAdminsMessage(COLOR_YELLOW,string,1);
	    }
    }
    return true;
}

COMMAND:contract(playerid, params[])
{
    new hitid,id,string[250],money;
    if(sscanf(params,"uud",hitid,id,money)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /contract [id киллера] [id жертвы] [сумма]");
	if(ProxDetectorS(5.0, playerid, hitid))
	{
	    if(IsAtMafia(hitid))
	    {
	        if(HitPlayer[hitid] == INVALID_PLAYER_ID || HitPlayer[hitid] == id)
	        {
				if(IsPlayerConnected(id))
				{
				    if(PlayerInfo[playerid][pLevel] >= 3)
				    {
					    if(money >= 150)
					    {
						    if(GetMoney(playerid) >= money)
						    {
						     	format(string,sizeof(string),"{FFFFFF}Игрок %s хочет заключить контракт с вами.\n\n{AFAFAF}Объект: {FF0000}%s{AFAFAF}\nСумма: {FF0000}$%d.\n\n{FFFFFF}Вы согласны выполнить данный заказ?", cPN(playerid), money, PN(id));
								if(!ShowPlayerDialogEx(hitid, 257, 0, "Контракт", string, "Да", "Нет"))
								{
								    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
								}
								else
								{
									format(string,sizeof(string),"Вы хотите заключить контракт с %s на убийство игрока %s на $%d", PN(hitid), PN(id), money);
									SendClientMessage(playerid, COLOR_LIME, string);
									ContractOffer[hitid] = playerid;
									ContractOffer[playerid] = hitid;
									ContractMoney[playerid] = money;
									ContractID[playerid] = id;
								}
								return true;
						    }
						    else
						    {
						        SendClientMessage(playerid, COLOR_GREY, "У вас нехватает наличных");
						    }
					    }
					    else
					    {
					        SendClientMessage(playerid, COLOR_GREY, "Используй: /contract [id/name] [сумма (Не менее $150)]");
					    }
				    }
				    else
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Нужно иметь 3-й уровень чтобы заказать игрока.");
				    }
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "Данного игрока нет на сервере.");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "На этом мафиози уже висит заказ.");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Это не мафиози.");
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "Вы должны быть рядом с киллером.");
	}
	return true;
}

COMMAND:id(playerid, params[])
{
    new id,string[256];
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /id [id/name]");
    if(IsPlayerConnected(id))
    {
        format(string,sizeof(string),"{FFFFFF}ID: {33CCFF}%d{FFFFFF} | Имя: {33CCFF}%s",id,PN(id));
        if(!ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,PN(id),string, "Ок"))
        {
            SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
        }
    }
    else SendClientMessage(playerid, COLOR_GREY, "Игрок не в сети");
    return true;
}

COMMAND:help(playerid, params[])
{
    AtMenu[playerid] = false;
	return ShowHelpDialog(playerid);
}

COMMAND:mm(playerid, params[])
{
	return cmd_menu(playerid,params);
}

COMMAND:kpk(playerid, params[])
{
	return cmd_menu(playerid,params);
}

COMMAND:updates(playerid, params[])
{
	AtMenu[playerid] = false;
	return ShowUpdateDialog(playerid);
}

COMMAND:menu(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
	    new string[260];
	    strcat(string,"1. Аккаунт\n");
	    strcat(string,"2. Связь с администрацией\n");
	    strcat(string,"3. Помощь по серверу\n");
	    strcat(string,"4. Обновления сервера\n");
	    strcat(string,"5. Настройки\n");
	    strcat(string,"6. Локации (GPS)\n");
	    strcat(string,"7. Платные услуги\n");
	    if(!IsARPName(PN(playerid))) strcat(string,"8. Сменить ник на РП");
	    if(!ShowPlayerDialogEx(playerid,61,2,"Выберите пункт",string,"Выбор","Выход"))
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	    }
	    else
	    {
	    	AtMenu[playerid] = true;
	    }
	}
	return true;
}

COMMAND:jobhelp(playerid, params[])
{
	if(!ShowPlayerDialogEx(playerid,135,2,"Помощь по работам","\
	1. Поставщик оружия\n\
	2. Детектив\n\
	3. АвтоУгонщик\n\
	4. Механик\n\
	5. Таксист\n\
	6. Тренер\n\
	7. Шахтёр\n\
	8. Экскурсовод\n\
	9. Инкассатор\n\
	10. Наркодиллер\n\
	11. Дальнобойщик\n\
	12. Вор\n\
	13. Развозчик металлолома\n\
	14. Мусоровоз","Выбор","Отмена"))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:pm(playerid, params[])
{
	if(!IsPlayerLogged[playerid]) return true;
	ShowPlayerDialogEx(playerid,74,2,"PM menu","Отправить сообщение\nВходящие сообщения","Выбор","Отмена");
	return true;
}
COMMAND:togpm(playerid, params[])
{
	if(PlayerInfo[playerid][pVIP] >= STATUS_GOLD)
	{
    	if(!HidePM[playerid])
    	{
    	    HidePM[playerid] = true;
    	    SendClientMessage(playerid,COLOR_GREY,"Вы отключили PM");
    	}
    	else
    	{
    	    HidePM[playerid] = false;
    	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы включили PM");
    	}
    }
    return true;
}

COMMAND:setint(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] > 0)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id;
	    if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setint [id]");
	    SetPlayerInterior(playerid,id);
    }
    return true;
}

COMMAND:quitjob(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] != JOB_NONE)
	{
	    if(PlayerInfo[playerid][pJob] == JOB_GUNDEALER) return SendClientMessage(playerid, COLOR_GREY, "С данной работы нельзя уволиться");
	    else if(PlayerInfo[playerid][pJob] == JOB_DRUGDEALER) return SendClientMessage(playerid, COLOR_GREY, "С данной работы нельзя уволиться");
	    else if(InJob[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "В данный момент вы работаете. Закончите работу и введите /quitjob");
        else if(!IsACop(playerid) || PlayerInfo[playerid][pJob] != JOB_DETECTIVE)
        {
		    if(PlayerInfo[playerid][pContractTime] < 1)
		    {
		        PlayerInfo[playerid][pJob] = JOB_NONE;
		        PlayerInfo[playerid][pContractTime] = 0;
		        SendClientMessage(playerid, COLOR_LIME, "Вы уволились с работы.");
		        ResetDynamicCPs(playerid);
		        SaveAccount(playerid);
		    }
		    else
			{
			    new string[100];
				format(string,sizeof(string),"До конца вашего рабочего контракта ещё {FF6347}%s",Convert(PlayerInfo[playerid][pContractTime]));
		    	SendClientMessage(playerid, COLOR_GREY,string);
			}
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы не можете уволиться т.к вы законник.");
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "Вы и так уже безработный.");
	}
	return true;
}

COMMAND:qjob(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /qjob [id/name]");
		if(PlayerInfo[id][pJob] != JOB_NONE)
		{
		    if(IsACop(id) && PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN) return SendClientMessage(playerid,COLOR_GREY,"Этот игрок законник, его нельзя уволить");
		    new string[70];
		    PlayerInfo[id][pJob] = JOB_NONE;
			format(string,sizeof(string),"Вы уволили игрока %s(%i) с работы",PN(id),id);
		    SendClientMessage(playerid, COLOR_GREY,string);
		    format(string,sizeof(string),"** Админ %s уволил вас с работы",PN(playerid));
		    SendClientMessage(id, COLOR_GREY,string);
		    SaveAccount(id);
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIGHTBLUE,"Он и так уже безработный");
		}
	}
	return true;
}

COMMAND:setname(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aSetName]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new name[24], id, string[100];
	    if(sscanf(params,"us[24]",id,name)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setname [id] [name]");
	    if(IsAFexistAccount(name)) return SendClientMessage(playerid, -1, "Это имя уже занято");
	    format(string, sizeof(string), "Вы сменили имя игрока %s[%d] на %s", PN(id),id,name);
	    SendClientMessage(playerid, -1, string);
	    format(string, sizeof(string), "** Админ %s сменил вам ник на %s", PN(playerid),name);
	    SendClientMessage(id, -1, string);
	    RenamePlayer(id,name);
	    UpdateHPBar(id);
    }
    return true;
}

COMMAND:mute(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aMute]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,time,reason[200];
        if(sscanf(params,"uds[50]",id,time,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /mute [id] [время] [причина]");
        format(reason,sizeof(reason),"** Администратор %s заглушил игрока %s[%d] на %d минут. Причина: %s",PN(playerid),PN(id),id,time,reason);
        SendClientMessageToAll(COLOR_LIGHTRED,reason);
        PlayerInfo[id][pMuteTime] = time*60;
	}
	return true;
}

COMMAND:repmute(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aMute]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,time,reason[200];
        if(sscanf(params,"uds[50]",id,time,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /mute [id] [время] [причина]");
        format(reason,sizeof(reason),"** Администратор %s дал бан '/report' игроку %s[%d] на %d минут. Причина: %s",PN(playerid),PN(id),id,time,reason);
        SendAdminsMessage(COLOR_LIGHTRED,reason,1);
        PlayerInfo[id][pRepBan] = time*60;
	}
	return true;
}

COMMAND:askmute(playerid, params[])
{
	if(PlayerInfo[playerid][pHelper] >= 1)
	{
	    new id,time,reason[200];
        if(sscanf(params,"uds[50]",id,time,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /mute [id] [время] [причина]");
        format(reason,sizeof(reason),"** Хелпер %s дал бан '/ask' игроку %s[%d] на %d минут. Причина: %s",PN(playerid),PN(id),id,time,reason);
        SendHelpersMessage(COLOR_LIGHTRED,reason,true);
        PlayerInfo[id][pAskBan] = time*60;
	}
	return true;
}

COMMAND:gethere(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!AdminInfo[playerid][aGethere]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new
			id,
			string[150],
			Float:X,
			Float:Z,
			Float:Y,
			Float:A;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /gethere [id]");
	    if(IsPlayerConnected(id))
	    {
		    GetPlayerPos(playerid,X,Y,Z);
		    GetPlayerFacingAngle(playerid, A);
		    ShiftCords(0, X, Y, Z, A, 3.0);
		    if(GetPlayerState(id) != 2) J_SetPlayerPos(id, X, Y, Z);
		    else J_SetVehiclePos(GetPlayerVehicleID(id), X, Y, Z);
		    BizEntered[id] = BizEntered[playerid];
		    HouseEntered[id] = HouseEntered[playerid];
		    SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
		    SetPlayerInterior(id,GetPlayerInterior(playerid));
		    format(string,sizeof(string),"** Вы были телепортированы админом %s",PN(playerid));
		    SendClientMessage(id,COLOR_LIGHTBLUE,string);
		    format(string,sizeof(string),"Вы телепортировали к себе игрока %s",PN(id));
		    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    }
	}
	return true;
}

COMMAND:goto(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!AdminInfo[playerid][aGotoid]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new
			id,
			string[150],
			Float:X,
			Float:Z,
			Float:Y;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /goto [id]");
		if(IsPlayerConnected(id))
		{
		    GetPlayerPos(id,X,Y,Z);
		    if(GetPlayerState(playerid) != 2) J_SetPlayerPos(playerid,X+2,Y+2,Z);
		    else J_SetVehiclePos(GetPlayerVehicleID(playerid),X+2,Y+2,Z);
		    BizEntered[playerid] = BizEntered[id];
		    HouseEntered[playerid] = HouseEntered[id];
		    SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
		    SetPlayerInterior(playerid,GetPlayerInterior(id));
		    format(string,sizeof(string),"Вы телепортировались к игроку %s",PN(id));
		    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    }
	}
	return true;
}

COMMAND:kick(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aKick]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(KickReset[playerid] <= 0)
	    {
		    new id, string[150], reason[100];
		    if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /kick [id] [Причина]");
		    if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
			{
			    format(string,sizeof(string),"** Игрок %s был кикнут сервером. Причина: Попытка кикнуть главного администратора",PN(playerid));
			   	SendClientMessageToAll(COLOR_LIGHTRED,string);
			   	J_Kick(playerid,"Попытка кикнуть гл. Админа");
			   	return true;
	  		}
	  		if(id == playerid && PlayerInfo[id][pAdmin] < ADM_GRAND_ADMIN) return SendClientMessage(playerid,COLOR_LIGHTRED,"Нельзя кикать самого себя");
		    format(string,sizeof(string),"** Админ %s кикнул игрока %s. Причина: %s",PN(playerid),PN(id),reason);
		    SendClientMessageToAll(COLOR_LIGHTRED,string);
		    WriteLog("Kick.log",string);
		    J_Kick(id,"Кикнут админами");
		    if(!GetString(PN(playerid),"Jack_Alliance")) KickReset[playerid] = 10;
	    }
	}
	return true;
}

COMMAND:name(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aKick]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(KickReset[playerid] <= 0)
	    {
		    new id, string[150];
		    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /name [id]");
			if(!IsARPName(PN(id))) return SendClientMessage(playerid, COLOR_GREY, "Этому игроку уже предложено сменить свой игровой ник.");
			if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
			{
			    format(string,sizeof(string),"** Игрок %s был кикнут сервером. Причина: Попытка кикнуть главного администратора",PN(playerid));
			   	SendClientMessageToAll(COLOR_LIGHTRED,string);
			   	J_Kick(playerid,"Попытка кикнуть гл.Админа");
			   	return true;
	  		}
		    format(string,sizeof(string),"** Игрок %s был кикнут админом %s за некорректный никнейм",PN(id),PN(playerid));
		    SendClientMessageToAll(COLOR_LIGHTRED,string);
		    WriteLog("Kick.log",string);
		    J_Kick(id,"Смени ник");
		    if(!GetString(PN(playerid),"Jack_Alliance")) KickReset[playerid] = 3;
		}
	}
	return true;
}


COMMAND:offtop(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aKick]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(KickReset[playerid] <= 0)
	    {
		    new id, string[150];
		    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /offtop [id]");
		    if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
			{
			    format(string,sizeof(string),"** Игрок %s был кикнут сервером. Причина: Попытка кикнуть главного администратора",PN(playerid));
			   	SendClientMessageToAll(COLOR_LIGHTRED,string);
			   	J_Kick(playerid,"Попытка кикнуть гл.Админа");
			   	return true;
	  		}
		    format(string,sizeof(string),"** Игрок %s получил заглушку на 10 минут был кикнут админом %s. Причина: (( Offtop ))",PN(id),PN(playerid));
		    SendClientMessageToAll(COLOR_LIGHTRED,string);
		    WriteLog("Kick.log",string);
		    J_Kick(id,"Offtop");
		    if(!GetString(PN(playerid),"Jack_Alliance")) KickReset[playerid] = 3;
		}
	}
	return true;
}

COMMAND:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_MODER)
	{
	    if(!AdminInfo[playerid][aBan]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(BanReset[playerid] <= 0)
	    {
		    new id, string[150], reason[100];
		    if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /ban [id] [Причина]");
		    if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
		    {
		    	format(string,sizeof(string),"** Игрок %s был забанен сервером. Причина: Попытка забанить главного администратора",PN(playerid));
		    	SendClientMessageToAll(COLOR_LIGHTRED,string);
		    	BanPlayer(playerid,"Попытка забанить главного администратора","Сервер");
		    	return true;
		    }
		    format(string,sizeof(string),"** Админ %s забанил игрока %s. Причина: %s",PN(playerid),PN(id),reason);
		    SendClientMessageToAll(COLOR_LIGHTRED,string);
		    WriteLog("Ban.log",string);
		    BanPlayer(id,reason,PN(playerid));
		    if(!GetString(PN(playerid),"Jack_Alliance")) BanReset[playerid] = 10;
	    }
	}
	return true;
}

COMMAND:jban(playerid, params[])
{
//    if(!AdminInfo[playerid][aBan]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(BanReset[playerid] <= 0)
	    {
		    new id, string[150], reason[100];
		    if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /ban [id] [Причина]");
		    if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
		    {
		    	format(string,sizeof(string),"** Игрок %s был забанен сервером. Причина: Попытка забанить главного администратора",PN(playerid));
		    	SendClientMessageToAll(COLOR_LIGHTRED,string);
		    	BanPlayer(playerid,"Попытка забанить главного администратора","Сервер");
		    	return true;
		    }
		    format(string,sizeof(string),"** Админ %s забанил игрока %s ( без лишнего шума ). Причина: %s",PN(playerid),PN(id),reason);
		    SendAdminsMessage(COLOR_LIGHTRED,string,7);
		    WriteLog("Ban.log",string);
		    BanPlayer(id,reason,PN(playerid));
		    if(!GetString(PN(playerid),"Jack_Alliance")) BanReset[playerid] = 5;
	    }
	}
	return true;
}

COMMAND:banip(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!AdminInfo[playerid][aBanIP]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(BanReset[playerid] <= 0)
	    {
		    new
				id,
				string[150],
				reason[100];
		    if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /banip [id] [Причина]");
		    if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN && id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
		    {
		    	format(string,sizeof(string),"** Игрок %s был забанен сервером. Причина: Попытка забанить главного администратора",PN(playerid));
		    	SendClientMessageToAll(COLOR_LIGHTBLUE,string);
		    	BanPlayer(id,"Попытка забанить главного администратора","Сервер");
		    	return true;
		    }
		    format(string,sizeof(string),"** Админ %s забанил игрока %s. Причина: %s",PN(playerid),PN(id),reason);
		    SendClientMessageToAll(COLOR_LIGHTRED,string);
		    WriteLog("Ban.log",string);
		    BanIP(PlayerIP(id));
		    J_Kick(id);
		    if(!GetString(PN(playerid),"Jack_Alliance")) BanReset[playerid] = 20;
	    }
	}
	return true;
}

COMMAND:warn(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aWarn]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(WarnReset[playerid] <= 0)
	    {
		    new
				id,
				string[150],
				reason[100];
		    if(sscanf(params,"us[150]",id,reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /warn [id] [Причина]");
		    if(PlayerInfo[id][pAdmin] < ADM_GRAND_ADMIN)
		    {
			    PlayerInfo[id][pWarns] ++;
			    if(PlayerInfo[id][pWarns] >= 3)
			    {
			        format(string,sizeof(string),"** Игрок %s был забанен админом %s. Причина: 3 варна",PN(id),PN(playerid));
		    		SendClientMessageToAll(COLOR_LIGHTRED,string);
		    		PlayerInfo[id][pWarns] = 0;
		    		BanPlayer(id,"3 Варна",PN(playerid));
		    		WarnReset[playerid] = 10;
		    		return true;
			    }
			    format(string,sizeof(string),"** Игрок %s получил варн от администратора %s. Причина: %s",PN(id),PN(playerid),reason);
			    SendClientMessageToAll(COLOR_LIGHTRED,string);
			    WriteLog("Warn.log",string);
			    J_Kick(id,"Кикнут с сервера [Warn]");
			    WarnReset[playerid] = 10;
		    }
		    else
		    {
		        if(id != playerid && !GetString(PN(playerid),"Jack_Alliance"))
			    {
			    	format(string,sizeof(string),"** Игрок %s был кикнут сервером. Причина: Попытка кикнуть главного администратора",PN(playerid));
			    	SendClientMessageToAll(COLOR_LIGHTRED,string);
					J_Kick(playerid,"Попытка кикнуть главного админа");
			    	return true;
			    }
		    }
	    }
	}
	return true;
}

COMMAND:gl(playerid, params[])
{
	return cmd_givelicense(playerid,params);
}

COMMAND:givelicense(playerid, params[])
{
    new id;
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER || GetTeamID(playerid) == TEAM_LICENSERS)
	{
	    if(!AdminInfo[playerid][aGiveLicense] && GetTeamID(playerid) != TEAM_LICENSERS) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
		if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /givelicense [id]");
	    if(IsPlayerLogged[id])
	    {
		    if(id != playerid || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
		    {
				PanelPlayerID[playerid] = id;
				new rank = PlayerInfo[playerid][pRank];
				if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
				{
					ShowPlayerDialogEx(playerid,6,2,"Выберите лицензию","\
					На вождение авто\n\
					На вождение мото\n\
					На полеты\n\
					На рыбалку\n\
					На вождение водного транспорта\n\
					На оружие\n\
					{33CCFF}Все лицензии","Выдать","Отмена");
				}
				else if(GetTeamID(playerid) == TEAM_LICENSERS && rank >= 3)
				{
                    ShowPlayerDialogEx(playerid,6,2,"Выберите лицензию","\
					На вождение авто [1lvl]\n\
					На вождение мото [1lvl]\n\
					На полеты [2lvl]\n\
					На рыбалку [2lvl]\n\
					На вождение водного транспорта [3lvl]\n\
					На оружие [3lvl]\n\
					{33CCFF}Все лицензии [3lvl]","Выдать","Отмена");
				}
				else
				{
				    if(GetTeamID(playerid) == TEAM_LICENSERS) return SendClientMessage(playerid, COLOR_GREY, "Ваш ранг слишком мал");
				    ShowPlayerDialogEx(playerid,6,2,"Выберите лицензию","\
					На вождение авто\n\
					На вождение мото","Выдать","Отмена");
				}
			}
		}
	}
	return true;
}

COMMAND:spec(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aSpec]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id;
	    if(sscanf(params,"ud",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /spec [id]");
		if(IsPlayerConnected(id))
		{
		    if(GetPlayerState(id) != PLAYER_STATE_SPECTATING)
		    {
		        if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
		        {
		            new weapon, ammo, Float:X[4];
		            new skin = GetSkinOfPlayer(playerid);
		            GetPlayerPos(playerid, X[0], X[1], X[2]);
		            GetPlayerFacingAngle(playerid, X[3]);
				    SetSpawnInfo(playerid, 255, skin, X[0], X[1], X[2], X[3], 0, 0, 0, 0, 0, 0);
					GetPlayerHealth(playerid, SpecInfo[playerid][specHealth]);
					GetPlayerArmour(playerid, SpecInfo[playerid][specArmour]);
					SpecInfo[playerid][specInt] = GetPlayerInterior(playerid);
					SpecInfo[playerid][specWorld] = GetPlayerVirtualWorld(playerid);
					SpecInfo[playerid][specSpectating] = true;
					for(new i; i < 13; i ++)
					{
						GetPlayerWeaponData(playerid, i, weapon, ammo);
						if(ammo > 0)
						{
						    SpecInfo[playerid][specGun][i] = weapon;
						    SpecInfo[playerid][specAmmo][i] = ammo;
						}
						else
						{
						    SpecInfo[playerid][specGun][i] = 0;
						    SpecInfo[playerid][specAmmo][i] = 0;
						}
					}
				}
				SetCameraBehindPlayer(playerid);
				SpecPlayerForPlayer(playerid, id);
				ShowMenuForPlayer(SpecMenu, playerid);
				if(PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN)
				{
					new string[50];
					format(string,sizeof(string),"За вами начал следить {33CCFF}%s",PN(playerid));
					SendClientMessage(id,COLOR_GREY,string);
				}
			}
			else SendClientMessage(playerid, COLOR_GREY, "Этот игрок находится в режиме слежения");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не на сервере");
	}
	return true;
}

COMMAND:specoff(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    Spectating[playerid] = false;
		TogglePlayerSpectating(playerid, false);
	    if(SpectatePlayer[playerid] != INVALID_PLAYER_ID)
	    {
		    OnSpawn[playerid] = true;
		    AntiCheatOFF[playerid][TELEPORT_HACK] = 2;
			SetPlayerHealth(playerid, SpecInfo[playerid][specHealth]);
			SetPlayerArmour(playerid, SpecInfo[playerid][specArmour]);
			SetPlayerInterior(playerid, SpecInfo[playerid][specInt]);
			SetPlayerVirtualWorld(playerid, SpecInfo[playerid][specWorld]);
			for(new i; i < 13; i ++)
			{
				if(SpecInfo[playerid][specGun][i] != 0)
				{
					GivePlayerWeaponEx(playerid, SpecInfo[playerid][specGun][i], SpecInfo[playerid][specAmmo][i]);
		  			SpecInfo[playerid][specGun][i] = 0;
		  			SpecInfo[playerid][specAmmo][i] = 0;
				}
			}
		}
	    SpectatePlayer[playerid] = INVALID_PLAYER_ID;
	}
	return true;
}

COMMAND:check(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aCheck]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /check [id]");
		if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в сети");
		if(id == playerid) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /menu ( Y )");
	    if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Нельзя смотерть статистику админа");
	    ShowStats(playerid,id);
	    AtMenu[playerid] = false;
	}
	return true;
}

COMMAND:checkw(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!AdminInfo[playerid][aCheck]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, gunstr[300], str[30];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /checkw [id]");
	    if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Нельзя смотерть оружия админа");
	    for(new i;i < 13;i ++)
	    {
	        new gunid,ammo;
	        GetPlayerWeaponData(id,i,gunid,ammo);
	        if(gunid != 0)
	        {
		        format(str,sizeof(str),"%s - %d\n",GunName(gunid),ammo);
		        strcat(gunstr,str);
	        }
	    }
	    ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Оружия",gunstr,"Ок","");
	}
	return true;
}

COMMAND:givegun(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, gunid, ammo, newparam;
	    if(sscanf(params,"uiii",id,gunid,ammo,newparam)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /givegun [id] [gunid] [ammo] [навсегда (1/0)]");
	    if(!IsABannedWeapon(gunid) || PlayerInfo[id][pAdmin] >= ADM_GRAND_ADMIN)
	    {
	    	if(newparam) J_GivePlayerWeapon(id,gunid,ammo);
	    	else GivePlayerWeaponEx(id,gunid,ammo);
	    }
	    else SendClientMessage(playerid,COLOR_GREY,"Нельзя давать запрещенное оружие обычным игрокам");
	}
	return true;
}

COMMAND:setammo(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, gunid, ammo;
	    if(sscanf(params,"udd",id,gunid,ammo)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /setammo [id] [gunid] [ammo]");
	    J_SetPlayerAmmo(id,gunid,ammo);
	}
	return true;
}

COMMAND:setstat(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aSetStat]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id, param1, param2, string[150];
	    if(sscanf(params,"udd",id,param1,param2))
		{
			SendClientMessage(playerid, -1, "Используй: /setstat [id] [код] [значение]");
			SendClientMessage(playerid, -1, "[0]Уровень | [1]Уважения | [2]Пол | [3]Возраст | [4]Предупреждения | [5]VIP | [6]Выговоры");
			SendClientMessage(playerid, -1, "[7]Номер телефона | [8]Ключи от дома | [9]Ключи от бизнеса | [10]Материалы | [11]Пакеты");
			SendClientMessage(playerid, -1, "[12]Работа | [13]Наркотики | [14]Счет в банке | [15]Donate счет");
			return true;
		}
		switch(param1)
		{
		    case 0:
		    {
		        J_SetPlayerScore(id,param2);
				format(string,sizeof(string),"Вы изменили уровень игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 1:
		    {
		        PlayerInfo[id][pExp] = param2;
				format(string,sizeof(string),"Вы изменили уважения игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 2:
		    {
		        PlayerInfo[id][pSex] = param2;
				format(string,sizeof(string),"Вы изменили пол игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 3:
		    {
		        PlayerInfo[id][pAge] = param2;
				format(string,sizeof(string),"Вы изменили возраст игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 4:
		    {
		        PlayerInfo[id][pWarns] = param2;
				format(string,sizeof(string),"Вы изменили кол-во предупреждений игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 5:
		    {
		        PlayerInfo[id][pVIP] = param2;
				format(string,sizeof(string),"Вы изменили VIP статус игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 6:
		    {
		        PlayerInfo[id][pFWarns] = param2;
				format(string,sizeof(string),"Вы изменили кол-во выговоров %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
		    }
		    case 7:
		    {
		        format(string,sizeof(string),"Phones/SIMCards/%d.ini",param2);
				if(!fexist(string))
				{
				    DeleteSimCard(PlayerInfo[id][pTelNum]);
				    PlayerInfo[id][pTelNum] = param2;
				    LoadSimCard(id, PlayerInfo[id][pTelNum]);
					format(string,sizeof(string),"Вы изменили телефон %s(%d) на %d",PN(id),id,param2);
					SendClientMessage(playerid,-1,string);
				}
		    }
		    case 8:
		    {
		        format(string,sizeof(string),"Вы изменили ключи от дома игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pHouseKey] = param2;
		    }
		    case 9:
		    {
		        format(string,sizeof(string),"Вы изменили ключи от бизнеса игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pBizKey] = param2;
		    }
		    case 10:
		    {
		        format(string,sizeof(string),"Вы изменили кол-во материалов игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pMats] = param2;
		    }
		    case 11:
		    {
		        format(string,sizeof(string),"Вы изменили кол-во пекетов игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pPackets] = param2;
		    }
		    case 12:
		    {
		        format(string,sizeof(string),"Вы изменили работу игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pJob] = param2;
		    }
		    case 13:
		    {
		        format(string,sizeof(string),"Вы изменили кол-во наркотиков игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pDrugs] = param2;
		    }
		    case 14:
		    {
		        format(string,sizeof(string),"Вы изменили счет в банке игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pBank] = param2;
		    }
		    case 15:
		    {
		        format(string,sizeof(string),"Вы изменили Donate счет игрока %s(%d) на %d",PN(id),id,param2);
				SendClientMessage(playerid,-1,string);
				PlayerInfo[id][pVirMoney] = param2;
		    }
		}
		SaveAccount(id);
	}
	return true;
}

COMMAND:noooc(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aOOC]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!OOCOFF)
	    {
	        OOCOFF = true;
	        SendClientMessageToAll(COLOR_LIGHTRED,"** Общий чат отключен администрацией сервера");
	    }
	    else
	    {
	        OOCOFF = false;
	        SendClientMessageToAll(COLOR_LIGHTBLUE,"** Общий чат включен администрацией сервера");
	    }
	}
	return true;
}

COMMAND:o(playerid, params[])
{
    new result[150], string[256];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
    if(!PlayerInfo[playerid][pOOC]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно включить общий чат");
    if(PlayerInfo[playerid][pLevel] == 1 && PlayerInfo[playerid][pExp] < 2)
    {
        return SendClientMessage(playerid,COLOR_GREY,"Писать в общий чат можно только после 2-х часов игры");
    }
	if(OOCReset[playerid] > 0)
	{
	    format(string,sizeof(string),"Подождите %d секунд прежде чем писать в общий чат",OOCReset[playerid]);
	    return SendClientMessage(playerid,COLOR_GREY,string);
	}
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /o [текст]");
	if(!OOCOFF)
	{
	 	format(string,sizeof(string),"[Общий чат]%s(%d): %s",PN(playerid),playerid,result);
		SendOOCMessage(COLOR_BLUENEW,string);
		WriteLog("OOCLog.log",string);
		if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN) OOCReset[playerid] = 30;
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Общий чат выключен");
	}
	return true;
}

COMMAND:news(playerid, params[])
{
    new result[150], string[256];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
    if(GetTeamID(playerid) == TEAM_RADIO && PlayerInfo[playerid][pRank] >= 3)
    {
		if(NewsReset[playerid] > 0)
		{
		    format(string,sizeof(string),"Подождите %d секунд прежде чем писать в News",OOCReset[playerid]);
		    return SendClientMessage(playerid,COLOR_GREY,string);
		}
		if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
		if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
		if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /news [текст]");
		new carid = GetPlayerVehicleID(playerid);
		if(carid != 0 && VehicleInfo[carid][vTeam] == TEAM_RADIO)
		{
		 	format(string,sizeof(string),"[News]%s %s: %s",GetRankName(TEAM_RADIO,PlayerInfo[playerid][pRank]),PN(playerid),result);
			SendClientMessageToAll(COLOR_ORANGE,string);
			NewsReset[playerid] = 5;
		}
		else
		{
		    SendClientMessage(playerid,COLOR_BLUENEW,"Вы не находитесь в транспорте радио студии");
		}
	}
	return true;
}

COMMAND:gov(playerid, params[])
{
    new result[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /gov [текст]");
	if(PlayerInfo[playerid][pRank] >= 10 && IsAtFrakcia(playerid))
	{
		SendGovMessage(playerid,true,result);
	}
	return true;
}

COMMAND:m(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /m [текст]");
	new carid = GetPlayerVehicleID(playerid);
	if(IsACop(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid) && IsACopCar(carid))
		{
			format(string,sizeof(string),"[M]%s %s(%d): %s",GetRankName(GetTeamID(playerid),PlayerInfo[playerid][pRank]),cPN(playerid),playerid,result);
			ProxDetector(30,playerid,string,COLOR_YELLOW);
		}
	}
	return true;
}

COMMAND:s(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /s [текст]");
	SetPlayerChatBubble(playerid, result, COLOR_YELLOW, 25.0, 5000);
	format(string,sizeof(string),"%s кричит: %s!!",cPN(playerid),result);
	ProxDetector(25,playerid,string,COLOR_WHITE,1);
	ApplyAnimation(playerid,"RIOT","RIOT_shout",4.0, 0, 1, 1, 0, 0, 1);
	return true;
}

COMMAND:u(playerid, params[])
{
    new result[150], string[256], id;
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"us[150]",id,result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /u [id] [текст]");
	format(string, sizeof(string), "Вы сказали игроку %s: %s", cPN(id), result);
	SendClientMessage(playerid, COLOR_WHITE, string);
	AudioMessage(id, result, "ru", true);
	return true;
}

COMMAND:b(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /b [текст]");
	format(string,sizeof(string),"%s говорит: (( {AFAFAF}%s{FFFFFF} ))",cPN(playerid),result);
	ProxDetector(10,playerid,string,COLOR_WHITE,1);
	return true;
}

COMMAND:c(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /c [текст]");
	format(string,sizeof(string),"%s говорит шёпотом: %s",cPN(playerid),result);
	ProxDetector(2,playerid,string,COLOR_WHITE);
	return true;
}

COMMAND:l(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /l [текст]");
	format(string,sizeof(string),"%s говорит: %s",cPN(playerid),result);
	ProxDetector(10,playerid,string,COLOR_WHITE);
	return true;
}

COMMAND:v(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new carid = GetPlayerVehicleID(playerid);
	    if(!IsAVelik(carid) && !IsABike(carid) && !IsAMoped(carid))
	    {
		    new result[100], string[150];
		    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
			if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
			if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
			if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /v [текст]");
			format(string,sizeof(string),"[Транспорт]%s говорит: %s",cPN(playerid),result);
			SendVehicleMessage(carid,COLOR_WHITE,string);
		}
	}
	return true;
}

COMMAND:w(playerid, params[])
{
    new result[100], string[150], id;
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"us[100]",id,result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /w [id] [текст]");
	if(ProxDetectorS(2,playerid,id))
	{
		format(string,sizeof(string),"* %s чтото шепчет игроку %s",cPN(playerid),cPN(id));
		ProxDetector(10,playerid,string,COLOR_PURPLE);
		format(string,sizeof(string),"Вы прошептали игроку %s: %s",cPN(id),result);
		SendClientMessage(playerid,COLOR_YELLOW,string);
		format(string,sizeof(string),"%s прошептал вам: %s",cPN(playerid),result);
		SendClientMessage(id,COLOR_YELLOW,string);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Вы далеко от этого игрока");
	}
	return true;
}

COMMAND:me(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /me [действие]");
	format(string,sizeof(string),"%s %s",cPN(playerid),result);
	ProxDetector(10,playerid,string,COLOR_PURPLE);
	return true;
}

COMMAND:do(playerid, params[])
{
    new result[100], string[150];
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /do [действие]");
	format(string,sizeof(string),"* %s (( %s ))",result, cPN(playerid));
	ProxDetector(10,playerid,string,COLOR_PURPLE);
	return true;
}

COMMAND:try(playerid, params[])
{
    new result[100], string[150], rand = random(10);
    if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Сначала нужно авторизироваться");
	if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
	if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(sscanf(params,"s[100]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /try [действие]");
	if(rand < 5)
	{
		format(string,sizeof(string),"* %s %s (( Удачно ))", cPN(playerid), result);
	}
	else
	{
	    format(string,sizeof(string),"* %s %s (( Не удачно ))", cPN(playerid), result);
	}
	ProxDetector(10,playerid,string,COLOR_PURPLE);
	return true;
}

COMMAND:saveaccounts(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    for(new i; i < GetMaxPlayersEx(); i ++)
	    {
	        if(!IsPlayerConnected(i)) continue;
	        if(!IsPlayerLogged[i]) continue;
	        SaveAccount(i);
	    }
	    SendClientMessage(playerid, COLOR_WHITE, "Все аккаунты сохранены.");
	}
	return true;
}

COMMAND:invite(playerid, params[])
{
	new id, string[100];
	if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /invite [id]");
	    if(IsPlayerConnected(id) && IsPlayerLogged[id])
	    {
	        if(PlayerInfo[id][pPlayHours] >= 2)
	        {
				if(!GetTeamID(id))
				{
				    if(!InMP[id])
				    {
					    if(!IsAtFrakcia(playerid) || (!PlayerInfo[id][pBL] && MedCardInfo[id][mcState] > 1))
					    {
					        if(ProxDetectorS(5.0, playerid, id))
					        {
								if(InviteOffer[id] == INVALID_PLAYER_ID)
								{
								    new Leader[15];
								    if(!IsARPName(PN(id)))
									{
									    SendClientMessage(playerid,COLOR_GREY,"У этого игрока NON-RP ник");
									    format(string, sizeof(string), "Лидер %s попытался принять вас к себе но не смог т.к у вас NON-RP ник", PN(playerid));
							            SendClientMessage(playerid,COLOR_WHITE,string);
							            SendClientMessage(playerid,COLOR_WHITE,"Пожалуйста, смените ник на RP (/menu > Сменить ник)");
										return true;
									}
								    if(PlayerInfo[playerid][pLeader] > 0) Leader = "Лидер";
								    else Leader = "Зам. лидера";
								    InviteOffer[id] = playerid;
								    format(string,sizeof(string),"Вы приглашаете игрока %s к себе в организацию",PN(id));
								    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
						        	format(string,sizeof(string),"%s %s приглашает вас к себе в организацию %s",Leader, PN(playerid), TeamName(GetTeamID(playerid)));
						        	if(!ShowPlayerDialogEx(id,8,0,"Инвайт",string,"Принять","Отмена"))
						        	{
						        	    SendClientMessage(playerid, COLOR_GREY, "Нельзя принять этого игрока в данный момент.");
						        	}
						        }
						        else
						        {
						            SendClientMessage(playerid,COLOR_GREY,"Этому игроку уже было выслано приглашение на вступление в организацию");
						            return true;
						        }
					        }
					        else
						    {
						    	SendClientMessage(playerid,COLOR_GREY,"Вы должны находиться рядом с игроком");
						    	return true;
						    }
				        }
				        else
				        {
				            SendClientMessage(playerid,COLOR_GREY,"Вы не можете принять этого игрока. Возможные причины:");
				            SendClientMessage(playerid,COLOR_GREY,"- Этот игрок находится в чёрном списке закона");
				            SendClientMessage(playerid,COLOR_GREY,"- У этого игрока нет мед. карты");
				            SendClientMessage(playerid,COLOR_GREY,"- Данный игрок психически не здоров");
					        return true;
				        }
			        }
			        else
				    {
				        SendClientMessage(playerid,COLOR_GREY,"Этот игрок находится на МП");
					    return true;
				    }
		        }
		        else
			    {
			        SendClientMessage(playerid,COLOR_GREY,"Этот игрок уже состоит в одной из организаций");
			        return true;
			    }
			}
            else
			{
		        SendClientMessage(playerid,COLOR_GREY,"Этот игрок должен проиграть не менее 2-х часов");
		      	return true;
			}
	    }
	}
	return true;
}

COMMAND:leaders(playerid, params[])
{
	if(!OrgsReset[playerid])
	{
		new str[100], string[2000];
		new Online[MAX_ORGS][26], TColor[MAX_ORGS][7];
		for(new i = 1;i < MAX_ORGS;i ++)
		{
		    if(GetString(OrgInfo[i][oLeader], "Свободна")) Online[i] = "", TColor[i] = "33CCFF";
			else Online[i] = "{FF6347}[Offline]", TColor[i] = "10F441";
		}
		for(new i; i < GetMaxPlayersEx(); i ++)
		{
		    if(IsPlayerConnected(i))
		    {
		    	new leader = PlayerInfo[i][pLeader];
		    	if(leader > 0) Online[leader] = "{33AA33}[Online]";
		    }
		}
		strcat(string,"________________ Гос. организации ________________\n");
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_LSPD),TeamName(TEAM_LSPD),TColor[TEAM_LSPD],OrgInfo[TEAM_LSPD][oLeader],Online[TEAM_LSPD]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_LVPD),TeamName(TEAM_LVPD),TColor[TEAM_LVPD],OrgInfo[TEAM_LVPD][oLeader],Online[TEAM_LVPD]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_FBI),TeamName(TEAM_FBI),TColor[TEAM_FBI],OrgInfo[TEAM_FBI][oLeader],Online[TEAM_FBI]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_SWAT),TeamName(TEAM_SWAT),TColor[TEAM_SWAT],OrgInfo[TEAM_SWAT][oLeader],Online[TEAM_SWAT]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_M4C),TeamName(TEAM_M4C),TColor[TEAM_M4C],OrgInfo[TEAM_M4C][oLeader],Online[TEAM_M4C]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_MERIALS),TeamName(TEAM_MERIALS),TColor[TEAM_MERIASF],OrgInfo[TEAM_MERIALS][oLeader],Online[TEAM_MERIALS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_MERIASF),TeamName(TEAM_MERIASF),TColor[TEAM_MERIASF],OrgInfo[TEAM_MERIASF][oLeader],Online[TEAM_MERIASF]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_MERIALV),TeamName(TEAM_MERIALV),TColor[TEAM_MERIALV],OrgInfo[TEAM_MERIALV][oLeader],Online[TEAM_MERIALV]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_LICENSERS),TeamName(TEAM_LICENSERS),TColor[TEAM_LICENSERS],OrgInfo[TEAM_LICENSERS][oLeader],Online[TEAM_LICENSERS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_RADIO),TeamName(TEAM_RADIO),TColor[TEAM_RADIO],OrgInfo[TEAM_RADIO][oLeader],Online[TEAM_RADIO]);
		strcat(string,str);
		strcat(string,"\n_____________________ Банды _____________________\n");
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_RACERS),TeamName(TEAM_RACERS),TColor[TEAM_RACERS],OrgInfo[TEAM_RACERS][oLeader],Online[TEAM_RACERS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_GROOVE),TeamName(TEAM_GROOVE),TColor[TEAM_GROOVE],OrgInfo[TEAM_GROOVE][oLeader],Online[TEAM_GROOVE]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_VAGOS),TeamName(TEAM_VAGOS),TColor[TEAM_VAGOS],OrgInfo[TEAM_VAGOS][oLeader],Online[TEAM_VAGOS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_BALLAS),TeamName(TEAM_BALLAS),TColor[TEAM_BALLAS],OrgInfo[TEAM_BALLAS][oLeader],Online[TEAM_BALLAS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_CORONOS),TeamName(TEAM_CORONOS),TColor[TEAM_CORONOS],OrgInfo[TEAM_CORONOS][oLeader],Online[TEAM_CORONOS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_RIFA),TeamName(TEAM_RIFA),TColor[TEAM_RIFA],OrgInfo[TEAM_RIFA][oLeader],Online[TEAM_RIFA]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_BIKERS),TeamName(TEAM_BIKERS),TColor[TEAM_BIKERS],OrgInfo[TEAM_BIKERS][oLeader],Online[TEAM_BIKERS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_CRIPS),TeamName(TEAM_CRIPS),TColor[TEAM_CRIPS],OrgInfo[TEAM_CRIPS][oLeader],Online[TEAM_CRIPS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_MS13),TeamName(TEAM_MS13),TColor[TEAM_MS13],OrgInfo[TEAM_MS13][oLeader],Online[TEAM_MS13]);
		strcat(string,str);
		strcat(string,"\n_____________________ Мафии _____________________\n");
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_RM),TeamName(TEAM_RM),TColor[TEAM_RM],OrgInfo[TEAM_RM][oLeader],Online[TEAM_RM]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_YAKUZA),TeamName(TEAM_YAKUZA),TColor[TEAM_YAKUZA],OrgInfo[TEAM_YAKUZA][oLeader],Online[TEAM_YAKUZA]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_LCN),TeamName(TEAM_LCN),TColor[TEAM_LCN],OrgInfo[TEAM_LCN][oLeader],Online[TEAM_LCN]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s\n",	GetTeamColor(TEAM_TRIADS),TeamName(TEAM_TRIADS),TColor[TEAM_TRIADS],OrgInfo[TEAM_TRIADS][oLeader],Online[TEAM_TRIADS]);
		strcat(string,str);
		format(str,sizeof(str),"{%s}%s: {%s}%s %s",		GetTeamColor(TEAM_UM),TeamName(TEAM_UM),TColor[TEAM_UM],OrgInfo[TEAM_UM][oLeader],Online[TEAM_UM]);
		strcat(string,str);

		if(!ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Лидерки",string,"Ок",""))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент");
		}
		OrgsReset[playerid] = 3;
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "Подождите 2-3 секунды");
	}
	return true;
}

COMMAND:frisk(playerid, params[])
{
	if(IsACop(playerid))
	{
		new id,string[200],Drugs[20],Mats[20],Gun[20];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /frisk [id]");
	    if(ProxDetectorS(1.0,playerid,id))
	    {
	        strcat(string,"{FFFFFF}");
	        if(PlayerInfo[id][pMats] > 0) Mats = "{33AA33}[Есть]\n";
	        else Mats = "{FF0000}[Нет]";
	        if(PlayerInfo[id][pDrugs] > 0) Drugs = "{33AA33}[Есть]\n";
	        else Drugs = "{FF0000}[Нет]";

	        new gunid, ammo;
	        Gun = "{FF0000}[Нет]";
	        for(new i;i < 13;i ++)
	        {
	            GetPlayerWeaponData(id, i, gunid, ammo);
	            if(!gunid || !ammo) continue;
	            Gun = "{33AA33}[Есть]\n";
	            break;
	        }
	        format(string, sizeof(string), "Материалы: \t%s\n", Mats);
	        format(string, sizeof(string), "%sНаркотики: \t%s\n", string, Drugs);
	        format(string, sizeof(string), "%sОружие: \t%s\n", string, Gun);

	        ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,PN(id),string,"Ок","");
	        format(string,sizeof(string),"* %s обыскивает игрока %s",cPN(playerid),cPN(id));
			ProxDetector(10,playerid,string,COLOR_PURPLE);
	    }
    }
    return true;
}

COMMAND:ticket(playerid, params[])
{
	if(IsACop(playerid))
	{
		new id,string[300],ticket,reason[50];
	    if(sscanf(params,"uds[50]",id,ticket,reason)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /ticket [id] [сумма] [причина]");
	    if(ProxDetectorS(5.0,playerid,id))
	    {
	        if(PlayerInfo[id][pLevel] > 1)
	        {
		        if(ticket > 0 && ticket <= 300)
		        {
					format(string,sizeof(string),"Законник %s выписал вам штрафф.\n\n{FF9900}Сумма: $%d\nПричина: %s",cPN(playerid),ticket,reason);
					if(!ShowPlayerDialogEx(id,87,0,"Штрафф",string,"Оплатить","Отмена"))
					{
					    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
					}
					else
					{
						format(string,sizeof(string),"Вы выписали штрафф игроку %s. Сумма: $%d | Причина: %s",PN(id),ticket,reason);
						SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
						TicketOffer[id] = playerid;
						TicketPrice[id] = ticket;
					}
		        }
		        else SendClientMessage(playerid, COLOR_WHITE, "Штраф не менее $1 и не более $300");
	        }
	        else SendClientMessage(playerid, COLOR_WHITE, "Нельзя выписывать штраф игрокам с 1-ым уровнем");
		}
		else SendClientMessage(playerid, COLOR_WHITE, "Вы далеко от игрока");
	}
	return true;
}

COMMAND:throwfish(playerid, params[])
{
	new string[100], massa, Fish[20];
	for(new i; i < 5; i ++)
 	{
 		new fish = PlayerFish[playerid][i];
 		if(fish == 0) strcat(string, "{AFAFAF}None\n");
 		else
 		{
 			format(Fish, sizeof(Fish), "{33CCFF}%s %d Kg\n", FishName[fish], FishMassa[playerid][fish]);
 			strcat(string, Fish);
 			massa += FishMassa[playerid][fish];
 		}
 	}
	if(massa > 0)
	{
		format(Fish, sizeof(Fish), "{33CCFF}Всю рыбу %d Kg\n", massa);
		strcat(string, Fish);
	}
 	ShowPlayerDialogEx(playerid,263,2,"Что выбросить?",string,"Выбросить","Отмена");
 	return true;
}

COMMAND:pay(playerid, params[])
{
	new id,money,string[200];
    if(sscanf(params,"ud",id,money)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /pay [id] [сумма]");
    if(!ResetPay[playerid])
    {
        if(ProxDetectorS(3.0,playerid,id))
		{
			if(playerid != id)
			{
				if(money > 0 && GetMoney(playerid) >= money)
				{
					if(PlayerInfo[playerid][pLevel] == 1) return SendClientMessage(playerid,COLOR_GREEN,"Вы должны быть 2-го уровня чтобы передавать деньги");
					if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN && money > 10000) return SendClientMessage(playerid,COLOR_GREEN,"Нельзя передавать больше 10000 руб");
					GiveMoney(playerid,-money,"Pay-");
					GiveMoney(id,money,"Pay+");
					ApplyAnimation(playerid,"DEALER","shop_pay",4.1, 0, 1, 1, 0, 0, 1);
					format(string,sizeof(string),"* Игрок %s передаёт конверт с деньгами игроку %s",cPN(playerid),cPN(id));
					ProxDetector(15.0,playerid,string,COLOR_PURPLE);
					format(string,sizeof(string),"Игрок %s передал вам %d руб",cPN(playerid),money);
					SendClientMessage(id,COLOR_GREY,string);
					format(string,sizeof(string),"Вы передали %d руб игроку %s",money,cPN(id));
					SendClientMessage(playerid,COLOR_GREY,string);
					format(string,sizeof(string),"%s передал игроку %s %d руб",PN(playerid),PN(id),money);
					WriteLog("PayLog.log",string);
					SaveAccount(playerid);
					SaveAccount(id);
					if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN) ResetPay[playerid] = 20;
				}
				else SendClientMessage(playerid,COLOR_GREY,"У вас нет столько денег");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Нельзя передавать деньги самому себе");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы далеко от игрока");
    }
    else SendClientMessage(playerid,COLOR_GREY,"Не прошло 10-и секунд с момента последней передачи денег");
	return true;
}

COMMAND:uninvite(playerid, params[])
{
	new id,string[200],reason[100];
    if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
	    if(sscanf(params,"us[100]",id,reason)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /uninvite [id] [причина]");
	    if(IsGiveWarn(playerid, id))
	    {
	        if(id != playerid)
	        {
	            if(PlayerInfo[id][pMember] == TEAM_LICENSERS)
	            {
		            LicensersCount = 0;
	                for(new i = 0;i < GetMaxPlayersEx();i ++)
					{
						if(!IsPlayerConnected(i)) continue;
						if(IsPlayerLogged[i] && GetTeamID(i) == TEAM_LICENSERS)
						{
						    LicensersCount ++;
						}
					}
					CheckLicensers();
				}
				PlayerInfo[id][pJob] = 0;
		        PlayerInfo[id][pMember] = 0;
		        PlayerInfo[id][pRank] = 0;
		        SetBumSkin(id);
		        format(string,sizeof(string),"{FFFFFF}%s выгнал вас из организации.\nПричина: %s",PN(playerid), reason);
		    	SendClientMessage(id,COLOR_LIGHTBLUE,string);
		    	format(string,sizeof(string),"Вы выгнали игрока %s. Причина: %s",PN(id), reason);
		    	SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
		    	J_SetPlayerColor(id,TeamColors[0]);
		    	ResetSpawnInfo(id, 0);
		    	ResetRobBankCP(id);
		    	SaveAccount(id);
	    	}
	    	else SendClientMessage(playerid,COLOR_GREY,"Себя нельзя");
	    }
	    else
		{
		    SendClientMessage(playerid,COLOR_GREY,"Этот игрок состоит в другой организации");
		}
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Вы не лидер и не зам. лидера");
	}
	return true;
}

COMMAND:giverank(playerid, params[])
{
	new id, rank, string[256];
	if(sscanf(params,"ud",id,rank)) return SendClientMessage(playerid,COLOR_GREEN,"Используйте: /giverank [id] [rank]");
	if(id == playerid) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Нельзя выдавать ранг себе");
	if(GetTeamID(playerid) == PlayerInfo[id][pMember])
	{
	    if(IsGiveRank(playerid, id, rank))
		{
			new change[10];
			if(PlayerInfo[id][pRank] > rank) change = "понизил";
			else if(PlayerInfo[id][pRank] < rank) change = "повысил";
			else return SendClientMessage(playerid,COLOR_GREEN,"Игрок имеет тот же ранг который вы хотете ему дать");
			format(string,sizeof(string),"Лидер вашей организации %s %s вас в должности.",PN(playerid),change);
			SendClientMessage(id,COLOR_LIGHTBLUE,string);
			format(string,sizeof(string),"Вы %sи игрока %s до %d-го ранга",change,PN(id),rank);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			PlayerInfo[id][pRank] = rank;
			if(PlayerInfo[id][pSex] == 2) SetPlayerSkin(id,GOrgSkins[GetTeamID(id)][rank]);
			else SetPlayerSkin(id,MOrgSkins[GetTeamID(id)][rank]);
			SaveAccount(id);
		}

	}
	else SendClientMessage(playerid,COLOR_GREEN,"Этот игрок не состоит в вашей организации");
	return true;
}

COMMAND:res(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new carslist[] = "{FF9900}Весь транспорт\nТранспорт новичков\nТранспорт отеля LS\nТранспорт отеля SF\nТранспорт отеля LV\nРыночные авто\nТранспорт для аренды\nТестовый транспорт";
	    ShowPlayerDialogEx(playerid, 265, 2, "Выберите транспорт", carslist, "Выбор", "Отмена");
	}
	return true;
}


COMMAND:addveh(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(IsPlayerInAnyVehicle(playerid))
	    {
			new car, price, string[256];
		    if(sscanf(params,"dd",car,price)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /addveh [Модель] [Цена]");
			if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_GREEN, "Номер Транспортного средства не может быть ниже 400 или выше 611 !");
			if(price < 0 || price > 999999999) return SendClientMessage(playerid, COLOR_GREEN, " Цена не меньше $0 и не больше $999999999");
			new carid = GetPlayerVehicleID(playerid);
			new Float:X,Float:Y,Float:Z,Float:A;
			GetVehiclePos(carid, X,Y,Z);
			GetVehicleZAngle(carid,A);
			for(new i;i < CREATEDCARS;i ++)
			{
			    DestroyVehicleEx(CreatedCar[i]);
			}
			CREATEDCARS = 0;
			SetTimerEx("CreateOwnableCar",2000,0,"ddffff",car,price,X,Y,Z,A);
			format(string, sizeof(string), "* Вы создали транспорт [%s]. Он появится через 2-3 секунды", GetVehicleName(car));
			SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		}
	}
	return true;
}

COMMAND:stopbus(playerid, params[])
{
	if(IsPlayerNPC(playerid))
	{
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        new carid = GetPlayerVehicleID(playerid);
	        new id, string[120];
			sscanf(params, "u", id);
			format(string, sizeof(string), "Игрок {FF0000}%s{FFFFFF} попросил остановить автобус на следующей остановке", PN(id));
			SendVehicleMessage( carid, COLOR_WHITE, string );
	    }
	}
	return true;
}

COMMAND:veh(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!AdminInfo[playerid][aVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new
		    car,
		    color1,
		    color2,
			string[256];
	    if(sscanf(params,"ddd",car,color1,color2)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /veh [model] [color1] [color2]");
		if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_GREEN, "Номер Транспортного средства не может быть ниже 400 или выше 611 !");
		if(color1 < 0 || color1 > 126 || color2 < 0 || color2 > 126) return SendClientMessage(playerid, COLOR_GREEN, " Номер цвета от 0 до 126 !");
		new Float:X,Float:Y,Float:Z,Float:A;
		GetPlayerPos(playerid, X,Y,Z);
		GetPlayerFacingAngle(playerid,A);
		CreatedCar[CREATEDCARS] = J_AddStaticVehicleEx(car, X,Y,Z,A, color1, color2, 1000000);
		new carid = CreatedCar[CREATEDCARS];
		SetVehicleNumberPlate(carid, "Тестовая");
		J_SetVehicleHealth(carid,100000);
		TempStripObject[carid] = -1;
		Fuel[carid] = GasMax;
		CCT[carid] = true;
		format(string, sizeof(string), "* Вы создали транспорт [%d].", carid);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		printf("Админ %s создал транспорт. ID: %d | Model: %s[%d]",PN(playerid),carid,GetVehicleName(GetVehicleModelEx(carid)),GetVehicleModelEx(carid));
		ADD_VEHICLES ++;
		CREATEDCARS ++;
	}
	return true;
}

COMMAND:veh1(playerid, params[])
{

	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aVeh]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new
		    car,
		    color1,
		    color2,
			string[256];
	    if(sscanf(params,"ddd",car,color1,color2)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /veh1 [model] [color1] [color2]");
		if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_GREEN, "Номер Транспортного средства не может быть ниже 400 или выше 611 !");
		if(color1 < -1 || color1 > 126 || color2 < -1 || color2 > 126) return SendClientMessage(playerid, COLOR_GREEN, " Номер цвета от -1 до 126 !");
  		new Float:X,Float:Y,Float:Z,Float:A;
		GetPlayerPos(playerid, X,Y,Z);
		GetPlayerFacingAngle(playerid,A);
		CreatedCar[CREATEDCARS] = J_AddStaticVehicleEx(car, X,Y,Z,A, color1, color2, 1000000);
		new carid = CreatedCar[CREATEDCARS];
		J_PutPlayerInVehicle(playerid,carid,0);
		SetVehicleNumberPlate(carid, "Тестовая");
		J_SetVehicleHealth(carid,100000);
		TempStripObject[carid] = -1;
		Fuel[carid] = 100;
		format(string, sizeof(string), "* Вы создали транспорт [%d].", carid);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		printf("Админ %s создал транспорт. ID: %d | Model: %s[%d]",PN(playerid),carid,GetVehicleName(GetVehicleModelEx(carid)),GetVehicleModelEx(carid));
		ADD_VEHICLES ++;
		CREATEDCARS ++;
	}
	return true;
}

COMMAND:carhp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id, Float:hp, string[256];
	    if(sscanf(params,"df",id,hp)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /carhp [id] [ammount]");
		J_SetVehicleHealth(id,hp);
		format(string,sizeof(string),"Вы установили транспорту [%d] %.0f ХП",id,hp);
		SendClientMessage(playerid,COLOR_GREY,string);
	}
	return true;
}

COMMAND:settire(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new status, string[256];
	    if(sscanf(params,"d",status)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /settire [ammount]");
		new c_panels, c_doors, c_lights, c_tires;
		GetVehicleDamageStatus(GetPlayerVehicleID(playerid), c_panels, c_doors, c_lights, c_tires);
		UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), c_panels, c_doors, c_lights, status);
		format(string,sizeof(string),"Вы установили транспорту [Tire: %d]",status);
		SendClientMessage(playerid,COLOR_GREY,string);
	}
	return true;
}

COMMAND:setsh(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id, Float:hp, string[256];
	    if(sscanf(params,"uf",id,hp)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /setsh [id] [ammount]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pAdmin] <= PlayerInfo[playerid][pAdmin])
	        {
				format(string,sizeof(string),"Вы установили игроку %s[%d] %.0f Shield",PN(id),id,hp);
				SendClientMessage(playerid,COLOR_GREY,string);
				PlayerInfo[id][pShield] = hp;
				UpdatePlayerShield(id, PlayerInfo[id][pShield]);
				if(hp > 0)
				{
					if(!UsingShield[id]) SetPlayerAttachedObjectEx(id, 6, 18637, 1, 0.15, -0.05, 0.18, 90, 0, 270);
					else SetPlayerAttachedObjectEx(id, 6, 18637, 14, 0.0, 0.0, 0.0, 0.0, 180.0, 180.0);
				}
				else RemovePlayerAttachedObjectEx(id, 6);
			}
			else SendClientMessage(playerid,COLOR_GREY,"Нельзя изменять ХП админам старше вас по рангу");
		}
	}
	return true;
}

COMMAND:sethp(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id, Float:hp, string[256];
	    if(sscanf(params,"uf",id,hp)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /sethp [id] [ammount]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pAdmin] <= PlayerInfo[playerid][pAdmin])
	        {
	            if(hp <= 100 || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	            {
	                if(Damaged[id] == -1 || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	                {
				        if(hp <= 0) INVALID_DEATH = true;
						J_SetPlayerHealth(id,hp);
						format(string,sizeof(string),"Вы установили игроку %s[%d] %.0f ХП",PN(id),id,hp);
						SendClientMessage(playerid,COLOR_GREY,string);
					}
					else SendClientMessage(playerid,COLOR_GREY,"Нельзя во время боя");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Не больше 100 ХП");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Нельзя изменять ХП админам старше вас по рангу");
		}
	}
	return true;
}

COMMAND:setam(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new id, Float:hp, string[256];
	    if(sscanf(params,"uf",id,hp)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /setam [id] [ammount]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pAdmin] <= PlayerInfo[playerid][pAdmin])
	        {
	            if(hp <= 100 || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	            {
	                if(Damaged[id] == -1 || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	                {
						J_SetPlayerArmour(id,hp);
						format(string,sizeof(string),"Вы установили игроку %s[%d] %.0f %% брони",PN(id),id,hp);
						SendClientMessage(playerid,COLOR_GREY,string);
					}
					else SendClientMessage(playerid,COLOR_GREY,"Нельзя во время боя");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Не больше 100 %%");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Нельзя изменять броню админам старше вас по рангу");
		}
	}
	return true;
}

COMMAND:hpam(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		J_SetPlayerArmour(playerid,255);
		J_SetPlayerHealth(playerid,255);
	}
	return true;
}

COMMAND:mattach(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new slot1,id,slot2,Float:X[3],Float:Y[3],Float:Z[3];
	    sscanf(params,"dddfffffffff",slot1,id,slot2,X[0],Y[0],Z[0],X[1],Y[1],Z[1],X[2],Y[2],Z[2]);
		SetPlayerAttachedObjectEx(playerid, slot1, id, slot2, X[0], Y[0], Z[0], X[1], Y[1], Z[1], X[2],Y[2],Z[2]);
	}
	return true;
}

COMMAND:gattach(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new slot1,id,slot2,Float:X[3],Float:Y[3],Float:Z[3];
	    sscanf(params,"dddfffffffff",slot1,id,slot2,X[0],Y[0],Z[0],X[1],Y[1],Z[1],X[2],Y[2],Z[2]);
		SetPlayerAttachedObjectEx(playerid, slot1, GetWeaponModel(id), slot2, X[0], Y[0], Z[0], X[1], Y[1], Z[1], X[2],Y[2],Z[2]);
	}
	return true;
}

COMMAND:crash(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /crash [id]");
		SetPlayerAttachedObjectEx(id, 0, 371, 0, 0.0, 0.0, 0.0, 0, 0, 0, 0.0, 0.0, 0.0);
	}
	return true;
}

COMMAND:a(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new result[150], string[200];
	    if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /a [текст]");
	    else if(PlayerInfo[playerid][pAdmin] == ADM_MODER) format(string,sizeof(string),"[A] {FF6347}Модератор {FFFFFF}%s: {BFC0C2}%s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_MODER) format(string,sizeof(string),"[A] {FF6347}Ст.Модератор {FFFFFF}%s: {BFC0C2}%s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_ADMIN) format(string,sizeof(string),"[A] {FF6347}Администратор {FFFFFF}%s: {BFC0C2}%s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_ADMIN) format(string,sizeof(string),"[A] {FF6347}Ст.Администратор {FFFFFF}%s: {BFC0C2}%s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_GRAND_ADMIN) format(string,sizeof(string),"[A] {FF0000}Гл.Администратор {FFFFFF}%s: {BFC0C2}%s",PN(playerid),result);
	    SendAdminsMessage(COLOR_WHITE,string,1);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Вы не можете писать в админ-чат");
	}
	return true;
}

COMMAND:h(playerid, params[])
{
	if(PlayerInfo[playerid][pHelper] > 0 || PlayerInfo[playerid][pAdmin] > ADM_NONE)
	{
	    new
	        result[150],
			string[200];
	    if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /h [текст]");
	    if(PlayerInfo[playerid][pHelper] == 1) format(string,sizeof(string),"[H] Мл. Хелпер %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pHelper] == 2) format(string,sizeof(string),"[H] Хелпер %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pHelper] == 3) format(string,sizeof(string),"[H] Гл. Хелпер %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_MODER) format(string,sizeof(string),"[H] Модератор %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_MODER) format(string,sizeof(string),"[H] Ст.Модератор %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_ADMIN) format(string,sizeof(string),"[H] Администратор %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_ADMIN) format(string,sizeof(string),"[H] Ст.Администратор %s: %s",PN(playerid),result);
	    else if(PlayerInfo[playerid][pAdmin] == ADM_GRAND_ADMIN) format(string,sizeof(string),"[H] Гл.Администратор %s: %s",PN(playerid),result);
	    SendHelpersMessage(COLOR_LIME,string,true);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_GREY,"Вы не можете писать в чат хелперов");
	}
	return true;
}

COMMAND:makeleader(playerid, params[])
{

	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeLeader]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,org[100],allorgs[2000],string[100];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /makeleader [id]");
		if(!IsARPName(PN(id)))
		{
		    SendClientMessage(playerid,COLOR_GREY,"У этого игрока NON-RP ник");
		    format(string, sizeof(string), "Администратор %s попытался назначить вас лидером но не смог т.к у вас NON-RP ник", PN(playerid));
            SendClientMessage(playerid,COLOR_WHITE,string);
            SendClientMessage(playerid,COLOR_WHITE,"Пожалуйста, смените ник на RP (/menu > Сменить ник)");
			return true;
		}
		//if(GetString(PlayerFName[id],"No Forum Name")) return SendClientMessage(playerid,COLOR_GREY,"Этот человек не указал свой форумный ник");
		for(new i = 1;i < MAX_ORGS;i ++)
		{
			format(org,sizeof(org),"%s\n",TeamName(i));
			strcat(allorgs,org);
		}
		format(string, sizeof(string),"%s | %s", PN(id), PlayerFName[id]);
		ShowPlayerDialogEx(playerid,26,2,string,allorgs,"Выбор","Отмена");
		MLPlayer[playerid] = id;
	}
	return true;
}

COMMAND:nameml(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(!AdminInfo[playerid][aMakeLeader]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    new name[24],org[100],allorgs[2000],string[150];
	    if(sscanf(params,"s[24]",name)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /nameml [name]");
	    if(IsAFexistAccount(name))
	    {
			new id = GetNameID(name);
			if(id == INVALID_PLAYER_ID)
			{
		        new FName[30];
		        format(string, sizeof(string), "SELECT `ForumName` FROM `Accounts` WHERE `NickName` = '%s' LIMIT 1", name);
		        mysql_query(string);
		        mysql_store_result();
				if(mysql_num_rows() > 0)
				{
				    mysql_fetch_field("ForumName", FName);
			        if(GetString(FName,"No Forum Name")) return SendClientMessage(playerid,COLOR_GREY,"Этот человек не указал свой форумный ник");
					for(new i = 1;i < MAX_ORGS;i ++)
					{
						format(org,sizeof(org),"%s\n",TeamName(i));
						strcat(allorgs,org);
					}
					ShowPlayerDialogEx(playerid,143,2,"Лидерки",allorgs,"Выбор","Отмена");
					SetString(MLName[playerid],name);
				}
				else SendClientMessage(playerid, COLOR_GREY, "Этого аккаунта не существует");
				mysql_free_result();
			}
			else
			{
			    return cmd_makeleader(playerid, name);
			}
		}
		else SendClientMessage(playerid, COLOR_GREY, "Этого аккаунта не существует");
	}
	return true;
}

COMMAND:ao(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_MODER)
	{
	    if(!AdminInfo[playerid][aAdminOOC]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new
	        result[150],
			string[256],
			Admin[30];
        if(PlayerInfo[playerid][pHelper] == 1) Admin = "Мл. Хелпер";
		else if(PlayerInfo[playerid][pHelper] == 2) Admin = "Хелпер";
		else if(PlayerInfo[playerid][pHelper] == 3) Admin = "Гл. Хелпер";
	  	else if(PlayerInfo[playerid][pAdmin] == ADM_MODER) Admin = "Модератор";
	  	else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_MODER) Admin = "Ст.Модератор";
	  	else if(PlayerInfo[playerid][pAdmin] == ADM_ADMIN) Admin = "Администратор";
	  	else if(PlayerInfo[playerid][pAdmin] == ADM_SUPER_ADMIN) Admin = "Ст.Администратор";
	  	else if(PlayerInfo[playerid][pAdmin] == ADM_GRAND_ADMIN) Admin = "Гл.Администратор";
	    if(sscanf(params,"s[150]",result)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /ao [текст]");
		format(string,sizeof(string),"** %s %s: %s",Admin,PN(playerid),result);
	    SendClientMessageToAll(COLOR_GOLD,string);
	}
	return true;
}

COMMAND:anims(playerid, params[])
{
	if(!IsPlayerLogged[playerid]) return true;
	if(!IsANotControllable(playerid))
	{
	    new animslist[] = "\
		Руки вверх\n\
		Справлять нужду\n\
		Танец (1)\n\
		Танец (2)\n\
		Танец (3)\n\
		Танец (4)\n\
		Танец (5)\n\
		Танец (6)\n\
		Танец (7)\n\
		Танец (8)\n\
		Танец (9)\n\
		Танец(10)\n\
		Курить\n\
		Возмущение\n\
		Присесть (1)\n\
		Присесть (2)\n\
		Присесть (3)\n\
		Присесть (4)\n\
		Лежать (1)\n\
		Лежать (2)\n\
		Жест рукой (1)\n\
		Жест рукой (2)\n\
		Читать рэп\n\
		Зивать\n\
		Диллер (1)\n\
		Диллер (2)\n\
		Диллер (3)\n\
		Диллер (4)\n\
		Пьяная походка\n\
		Рука лицо";
		ShowPlayerDialog(playerid,20,DIALOG_STYLE_LIST, "Анимации", animslist, "Выбрать", "Отмена");
	}
	else SendClientMessage(playerid, COLOR_RED, "Недоступно в данный момент");
	return true;
}

COMMAND:park(playerid, params[])
{
	if(IsPlayerInHisVehicle(playerid))
	{
	    if(GetPlayerState(playerid) == 2)
	    {
			new carid = GetPlayerVehicleID(playerid);
			new Float:Health,panels,doors_,lights_,tires;
			GetVehicleDamageStatus(carid,panels,doors_,lights_,tires);
			GetVehicleHealth(carid,Health);
			new number = GetVehicleID(carid);
			AntiCheatOFF[playerid][VEH_ROOT_HACK] = 2;
			AntiCheatOFF[playerid][CAR_HEALTH_HACK] = 2;
			GetVehiclePos(carid,CarInfo[number][cPos_X],CarInfo[number][cPos_Y],CarInfo[number][cPos_Z]);
			GetVehicleZAngle(carid,CarInfo[number][cPos_A]);
		    DestroyVehicleEx(carid);
		    VehicleHealth[carid] = 1000;
		    J_SetVehicleHealth(carid,1000);
			J_AddStaticVehicleEx(CarInfo[number][cModel],CarInfo[number][cPos_X],CarInfo[number][cPos_Y],CarInfo[number][cPos_Z],CarInfo[number][cPos_A],CarInfo[number][cColor_1],CarInfo[number][cColor_2],1000000);
            //SetVehicleNumberPlate(carid,CarInfo[number][cNumber]);
			J_PutPlayerInVehicle(playerid,carid,0);
			UpdateVehicleDamageStatus(carid,panels,doors_,lights_,tires);
			SetTimerEx("ModCar",1000,false,"d",carid);
			SaveOwnableCar(number);
			return true;
		}
	}
	return true;
}

COMMAND:sellcar(playerid, params[])
{
    new carid = GetPlayerVehicleID(playerid);
	if(IsAOwnableCar(carid))
	{
		if(IsPlayerInHisVehicle(playerid))
		{
		    if(IsPlayerRegCar(playerid,carid))
		    {
			    if(IsAtAutoMarket(playerid))
			    {
			        new string[100];
					new number = GetVehicleID(carid);
					new cost = CarInfo[number][cCost]/2;
					GiveMoney(playerid,cost,"SellCar");
					SellCar(carid);
					format(string,sizeof(string),"Вы продали ваше транспортное средство за $%d",cost);
				  	SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
				  	GetNumberCars(playerid,PlayerInfo[playerid][pCars]);
				  	SaveAccount(playerid);
				  	format(string, sizeof(string), "Игрок %s продал транспорт %s[%i] за $%d", PN(playerid), GetVehicleName(CarInfo[number][cModel]),carid, cost);
					WriteLog("SellCar.log", string);
			  	}
			  	else
			  	{
			  	    SendClientMessage(playerid,COLOR_GREY,"Вы не на авторынке");
			  	}
		  	}
		}
		else
		{
		  	SendClientMessage(playerid,COLOR_GREY,"Вы должны сидеть в личном транспорте");
		}
	}
	return true;
}

COMMAND:givekey(playerid, params[])
{
	new id,car,string[200];
	if(sscanf(params,"ud",id,car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /givekey [id] [carid]");
	if(ProxDetectorS(10.0,playerid,id))
	{
	    if(IsPlayerHaveCar(playerid,car))
	    {
	        if(IsValidNumberCars(id))
			{
		        SetCarKeyer(car,PN(id));
		        format(string,sizeof(string),"Игрок %s отдал вам ключи от транспорта №%d",cPN(playerid),car);
		        SendClientMessage(id,COLOR_LIGHTBLUE,string);
		        format(string,sizeof(string),"Вы отдали игроку %s ключи от транспорта №%d",cPN(id),car);
		        SendClientMessage(id,COLOR_LIGHTBLUE,string);
		        GetNumberCars(id,PlayerInfo[id][pCars]);
		        SaveAccount(playerid);
		        SaveAccount(id);
	        }
	    }
	}
	return true;
}

COMMAND:sellcarto(playerid, params[])
{
	if(IsPlayerInHisVehicle(playerid))
	{
	    new carid = GetPlayerVehicleID(playerid);
	    new string[150];
	    if(IsPlayerRegCar(playerid, carid))
	    {
		    new id, cost, maxcost = floatround(GetCarPrice(GetVehicleID(carid)) * 1.25);
		    if(sscanf(params,"ud",id,cost)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /sellcarto [id] [cost]");
			if(IsPlayerConnected(id))
			{
				if(id != playerid)
				{
					if(!ProxDetectorS(7.0, playerid, id))
					{
					    SendClientMessage(playerid,COLOR_GREY,"Игрок должен быть рядом с транспортом");
					    return true;
					}
					if(CarOffer[id] != INVALID_PLAYER_ID)
					{
					    SendClientMessage(playerid,COLOR_GREY,"Этому игроку уже поступило предложение о покупке транспорта");
					    return true;
					}
					if(cost < 1)
					{
					    SendClientMessage(playerid,COLOR_GREY,"Цена может быть не меньше $1");
					    return true;
					}
					if(cost > maxcost)
					{
					    format(string, sizeof(string), "Максимальная стоимость для продажи данного транспорта $%d", maxcost);
					    SendClientMessage(playerid, COLOR_GREY, string);
					    return true;
					}
					if(PlayerInfo[playerid][pLevel] >= 2)
					{
			    		format(string,sizeof(string),"{FFFFFF}Вы предлагаете игроку %s купить у вас транспорт\n\nМодель: %s\nНомер: %d\nЦена: %d",
			    		PN(id),GetVehicleName(GetVehicleModelEx(carid)),carid,cost);
			    		ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Продажа транспорта",string,"Ок","");
						format(string,sizeof(string),"{FFFFFF}Игрок %s предлагает вам купить у него транспорт\n\nМодель: %s\nНомер: %d\nЦена: %d",
						PN(playerid),GetVehicleName(GetVehicleModelEx(carid)),carid,cost);
						ShowPlayerDialogEx(id,12,0,"Покупка транспорта",string,"Купить","Отмена");
						CarOffer[id] = playerid;
						CarOffer[playerid] = id;
						CarPrice[id] = cost;
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GREY,"Продавать транспорт другому игроку можно только со 2-го уровня");
					}
				}
			}
		}
	}
	return true;
}

COMMAND:key(playerid, params[])
{
	if(IsPlayerInHisVehicle(playerid))
	{
		if(IsANotControllable(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете двигаться в данный момент.");
		new string[128];
		new carid = GetPlayerVehicleID(playerid);
		new number = GetVehicleID(carid);
		if(CarInfo[number][cShtraf] > 0) return SendClientMessage(playerid,COLOR_GREY,"Этот транспорт стоит на штрафстоянке");
		if(CarInfo[number][cKeyIN])
  		{
			CarInfo[number][cKeyIN] = 0;
		    format(string,sizeof(string),"* Игрок %s вытащил ключи из замка зажигания",cPN(playerid));
		    ProxDetector(15.0,playerid,string,COLOR_PURPLE);
		    SetEngineStatus(carid,false);
	 	}
		else
		{
		    CarInfo[number][cKeyIN] = 1;
		    format(string,sizeof(string),"* Игрок %s вставил ключи в замок зажигания",cPN(playerid));
		    ProxDetector(15.0,playerid,string,COLOR_PURPLE);
		}
	}
	return true;
}

COMMAND:alarm(playerid, params[])
{
	new car;
	if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /alarm [id]");
	if(IsPlayerHaveCar(playerid,car))
	{
	    new number = GetVehicleID(car);
		if(!CarInfo[number][cAlarmON])
		{
			CarInfo[number][cAlarmON] = 1;
			SendClientMessage(playerid,COLOR_YELLOW,"Сигнализация включена");
		}
		else
		{
			CarInfo[number][cAlarmON] = 0;
			SendClientMessage(playerid,COLOR_RED,"Сигнализация вылючена");
			SetAlarmStatus(car,false);
		}
	}
	return true;
}

COMMAND:lock(playerid, params[])
{
	new car, string[50];
	if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /lock [id транспорта]");
	if(IsPlayerHaveCar(playerid,car))
	{
		new Float:X,Float:Y,Float:Z;
		GetVehiclePos(car,X,Y,Z);
		if(IsPlayerInRangeOfPoint(playerid,2.0,X,Y,Z))
		{
		    if(!IsABike(car) && !IsAVelik(car) && !IsAMoped(car))
			{
	 			new number = GetVehicleID(car);
				if(CarInfo[number][cLock])
				{
					SetDoorsStatus(car, 0);
					CarInfo[number][cLock] = 0;
					GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~ЏPAмCЊOPЏ~g~ OЏKP‘Џ",3000,3);
					format(string,sizeof(string),"* %s открывает личный транспорт", cPN(playerid));
					ProxDetector(15.0, playerid, string, COLOR_PURPLE);
					SaveOwnableCar(number);
				}
				else
				{
	 				SetDoorsStatus(car, 1);
					CarInfo[number][cLock] = 1;
					GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~ЏPAмCЊOPЏ~r~ €AKP‘Џ",3000,3);
					format(string,sizeof(string),"* %s закрывает личный транспорт", cPN(playerid));
					ProxDetector(15.0, playerid, string, COLOR_PURPLE);
					SaveOwnableCar(number);
				}
			}
			else SendClientMessage(playerid,COLOR_GREY,"Нельзя закрыть/открыть мототранспорт");
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"Вы должны стоять рядом с транспортом");
		}
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"Это не ваш транспорт");
	}
	return true;
}

COMMAND:findcar(playerid, params[])
{
	new car;
	if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /findcar [id транспорта]");
	if(IsPlayerHaveCar(playerid,car))
	{
		new Float:X,Float:Y,Float:Z;
		GetVehiclePos(car,X,Y,Z);
		EnableGPSForPlayer(playerid,X,Y,Z);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,"Ваш транспорт отмечен на карте");
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"Это не ваш транспорт");
	}
	return true;
}

COMMAND:deltun(playerid, params[])
{
	if(PlayerInfo[playerid][pVIP] >= STATUS_VIP)
	{
		new car;
		if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /deltun [id транспорта]");
		if(IsPlayerHaveCar(playerid,car))
		{
			DelTunCar(car);
			SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы удалили тюнинг с вашего транспорта");
		}
		else
		{
			SendClientMessage(playerid,COLOR_GREY,"Это не ваш транспорт");
		}
	}
	return true;
}

COMMAND:auninvite(playerid, params[])
{

	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!AdminInfo[playerid][aUnInvite]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /auninvite [id]");
	    if(PlayerInfo[id][pLeader] > 0 && PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Вы не можете увольнять лидеров");
	        return true;
	    }
	    if(PlayerInfo[id][pLeader] > 0)
	    {
	        new leader = PlayerInfo[id][pLeader];
	        SetString(OrgInfo[leader][oLeader],"Свободна");
	        format(string,sizeof(string),"DELETE FROM `forum_moderators` WHERE `member_name` = '%s'",PlayerFName[id]);
			mysql_query(string);
	        SaveOrg(leader);
	        //UpdateLeaders();
	    }
	    if(GetTeamID(id) == TEAM_LICENSERS)
	    {
     		LicensersCount = 0;
     		for(new i = 0;i < GetMaxPlayersEx();i ++)
			{
				if(!IsPlayerConnected(i)) continue;
				if(IsPlayerLogged[i] && GetTeamID(i) == TEAM_LICENSERS)
				{
					LicensersCount ++;
				}
			}
			CheckLicensers();
		}
	    PlayerInfo[id][pLeader] = 0;
	    PlayerInfo[id][pMember] = 0;
	    PlayerInfo[id][pRank] = 0;
	    SetBumSkin(id);
	    PlayerInfo[id][pJob] = 0;
	    ResetRobBankCP(id);
	    format(string,sizeof(string),"** Админ %s уволил вас из организации",PN(playerid));
	    SendClientMessage(id,COLOR_LIGHTBLUE,string);
	    format(string,sizeof(string),"Вы выгнали игрока %s из организации",PN(id));
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    J_SetPlayerColor(id,TeamColors[0]);
	    ResetSpawnInfo(id, 0);
	    SaveAccount(id);
	}
	return true;
}


COMMAND:ainvite(playerid, params[])
{

	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aUnInvite]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,team,rank,string[200];
	    if(sscanf(params,"uii",id,team,rank)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /ainvite [id] [team] [rank]");
	    if(PlayerInfo[id][pLeader] > 0)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Вы не можете принимать лидеров");
	        return true;
	    }
	    PlayerInfo[id][pMember] = team;
	    PlayerInfo[id][pRank] = rank;
	    ResetRobBankCP(id);
	    if(IsACop(id)) PlayerInfo[id][pJob] = JOB_DETECTIVE;
     	else if(GetTeamID(id) == TEAM_LICENSERS)
     	{
     		LicensersCount = 0;
     		for(new i = 0;i < GetMaxPlayersEx();i ++)
			{
				if(!IsPlayerConnected(i)) continue;
				if(IsPlayerLogged[i] && GetTeamID(i) == TEAM_LICENSERS)
				{
 					LicensersCount ++;
				}
			}
			CheckLicensers();
		}
		else if(IsAtGang(id))
		{
 			PlayerInfo[id][pJob] = JOB_DRUGDEALER;
 			ShowPlayerDialogEx(playerid, 18, 2, "Выберите свой путь", "Поставщик оружия\nНаркодиллер", "Выбор", "");
		}
	    format(string,sizeof(string),"** Админ %s принял вас в организацию \"%s\" %d-м рангом",PN(playerid), TeamName(team), rank);
	    SendClientMessage(id,COLOR_LIGHTBLUE,string);
	    format(string,sizeof(string),"Вы приняли игрока %s в организацю \"%s\" %d-м рангом",PN(id), TeamName(team), rank);
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    J_SetPlayerColor(id,TeamColors[team]);
	    ResetSpawnInfo(id, team);
	    SaveAccount(id);
	}
	return true;
}

COMMAND:exitteam(playerid, params[])
{
	new member = PlayerInfo[playerid][pMember];
	if(member > 0)
	{
		new leader;
		leader = GetString(OrgInfo[member][oLeader], "Свободна");
		new Name[24],Day,Month,Year,Second,Minute,Hour,IP[16],Time,result[300];
		format(result, sizeof(result), "SELECT * FROM `OnlineInfo` WHERE `Name` = '%s' LIMIT 1", OrgInfo[member][oLeader]);
		mysql_query(result);
		mysql_store_result();
		if(mysql_num_rows() > 0)
		{
			mysql_fetch_row(result, "|");
			sscanf(result,"p<|>s[24]s[16]ddddddd",
			Name,IP,Second,Minute,Hour,Day,Month,Year,Time);
		}
		new Float:days = LastSeconds(Hour, Minute, Second, Day, Month, Year) / 86400;
		if(PlayerInfo[playerid][pVIP] >= STATUS_GOLD || days >= 3.0 || leader)
		{
		    if(!PlayerInfo[playerid][pLeader])
		    {
			    PlayerInfo[playerid][pMember] = 0;
			    PlayerInfo[playerid][pRank] = 0;
			    PlayerInfo[playerid][pJob] = 0;
			    SetBumSkin(playerid);
			    J_SetPlayerColor(playerid,TeamColors[0]);
			    ResetSpawnInfo(playerid, 0);
			    ResetRobBankCP(playerid);
			    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы покинули организацию");
			   	SaveAccount(playerid);
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Эта команда доступна только обычным мемберам");
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"У вас нет Gold'a и лидер вашей организации был онлайн за последние 3 дня");
		}
	}
	return true;
}

COMMAND:rescar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        SetVehicleToRespawn(GetPlayerVehicleID(playerid));
	    }
	}
	return true;
}

COMMAND:weather(playerid, params[])
{
    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
    if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    new weather;
	    if(sscanf(params,"d",weather)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используй: /weather [id]");
	    J_SetWeather(weather);
	}
	return true;
}

COMMAND:su(playerid, params[])
{
	if(IsACop(playerid))
	{
	    if(PlayerInfo[playerid][pRank] >= 2)
	    {
			new reason[100], id, wanted;
		    if(sscanf(params, "uds[100]", id, wanted, reason)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /su [id] [розыск] [причина]");
		    if(IsPlayerConnected(id))
		    {
				if(!IsACop(id))
				{
				    if(!PlayerInfo[id][pJailTime])
		       		{
				        if(wanted < 1 || wanted > 10) return SendClientMessage(playerid,COLOR_GREY,"Нельзя дать меньше 1 и больше 10 звезд");
						SetPlayerCriminal(playerid,id,PlayerInfo[id][pWanted]+wanted,reason);
					}
					else
					{
					    SendClientMessage(playerid,COLOR_GREY,"Нельзя объявить в розыск заключенного");
					}
				}
				else
				{
				    SendClientMessage(playerid,COLOR_GREY,"Нельзя объявить в розыск законника");
				}
			}
    	}
    }
    return true;
}

COMMAND:ph(playerid, params[])
{
	return cmd_phone(playerid,"");
}

COMMAND:togphone(playerid, params[])
{
    if(PlayerInfo[playerid][pTelNum] != 0)
	{
	    if(PlayerInfo[playerid][pPhone] != 0)
	    {
			new string[70];
		    if(SimInfo[playerid][simPower])
		    {
		        SimInfo[playerid][simPower] = 0;
		        SendClientMessage(playerid, COLOR_WHITE, "Вы {FF0000}выключили{FFFFFF} телефон");
		        StopUseTelephone(playerid);
		    }
			else
			{
			    SimInfo[playerid][simPower] = 1;
			    SendClientMessage(playerid, COLOR_WHITE, "Вы {33AA33}включили{FFFFFF} телефон");
			}
			format(string, sizeof(string),"Phones/SIMCards/%d.ini", SimInfo[playerid][simNumber]);
			new File = ini_openFile(string);
			if(File >= 0)
			{
		 		ini_setInteger(File, "Power", SimInfo[playerid][simPower]);
				ini_closeFile(File);
		 	}
		}
 	}
	return true;
}

COMMAND:phone(playerid, params[])
{
	if(PlayerInfo[playerid][pTelNum] != 0)
	{
	    if(PlayerInfo[playerid][pPhone] != 0)
	    {
		    if(LiveOffer[playerid] == INVALID_PLAYER_ID)
		    {
			    if(SimInfo[playerid][simPower])
				{
				    if(!UsedPhone[playerid])
				    {
						StartUseTelephone(playerid);
					}
					else StopUseTelephone(playerid);
			    }
			    else
			    {
			        SendClientMessage(playerid,COLOR_GREY,"Телефон выключен.");
			    }
		    }
		    else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Нельзя пользоваться телефоном во время интервью");
			}
		}
		else
		{
  			SendClientMessage(playerid,COLOR_GREY,"У вас нет телефона");
		}
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"У вас нет SIM карты");
	}
	return true;
}
COMMAND:r(playerid, params[])
{
	new string[128];
    if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
    if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
    if(PlayerInfo[playerid][pFMuteTime] > 0) return SendClientMessage(playerid, COLOR_GREY, "Лидер заглушил вас и вы не можете писать в /r чат");
	if(GetTeamID(playerid) > 0)
	{
	    if(sscanf(params,"s[150]",string)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /r [text]");
		format(string,sizeof(string),"%s %s: %s",GetRankName(GetTeamID(playerid),PlayerInfo[playerid][pRank]),PN(playerid),string);
		SendTeamMessage(GetTeamID(playerid),0x00FFFFFF,string);
		SetPlayerChatBubble(playerid, "Сообщение по рации", COLOR_PURPLE, 10.0, 5000);
	}
	return true;
}

COMMAND:d(playerid, params[])
{
	new
		string[200];
    if(PlayerInfo[playerid][pMuteTime] > 0) return SendMuteMessage(playerid);
    if(Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете разговаривать с кляпом во рту.");
	if(IsAtFrakcia(playerid, 1))
	{
	    if(sscanf(params,"s[150]",string)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /d [text]");
		format(string,sizeof(string),"%s %s: %s",GetRankName(GetTeamID(playerid),PlayerInfo[playerid][pRank]),PN(playerid),string);
		SendGosMessage(COLOR_LIGHTRED,string);
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы не уполномочены писать в государственный чат");
	return true;
}

COMMAND:roliki(playerid, params[])
{
	new string[150];
	new skin = GetPlayerSkin(playerid);
	switch(skin)
	{
	    case 254, 27:
	    {
	        SendClientMessage(playerid, COLOR_GREY, "В данный момент недоступно");
	    }
	    case 99:
	    {
	        SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
	    	format(string,sizeof(string),"* %s снимает ролики",cPN(playerid));
			ProxDetector(10,playerid,string,COLOR_PURPLE);
	    }
	    default:
	    {
	        PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
	    	SetPlayerSkin(playerid,99);
	    	format(string,sizeof(string),"* %s одевает ролики",cPN(playerid));
			ProxDetector(10,playerid,string,COLOR_PURPLE);
	    }
	}
	return true;
}

COMMAND:makeadmin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeAdmin]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,admin,string[200];
	    if(sscanf(params,"ud",id,admin)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /makeadmin [id] [level (0 - 7)]");
	    if(IsPlayerConnected(id))
	    {
	        if(admin < 0 || admin > 7) return SendClientMessage(playerid,COLOR_GREEN,"Используйте: /makeadmin [id] [level (0 - 7)]");
	        format(string,sizeof(string),"** Админ %s выдал вам %d-й уровень администратирования",PN(playerid),admin);
	        SendClientMessage(id,COLOR_LIGHTBLUE,string);
	        format(string,sizeof(string),"Вы выдали игроку %s %d-й уровень администратирования",PN(id),admin);
	        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	        SetAdminLevel(id,admin);
	        format(string,sizeof(string),"** %s назначил игрока %s админом %d-го уровня",PN(playerid),PN(id),admin);
	        WriteLog("MakeAdmin.log",string);
	        if(PlayerInfo[id][pHelper] > 0)
	        {
	        	PlayerInfo[id][pHelper] = 0;
	        }
	        SaveAccount(id);
	    }
	}
	return true;
}

COMMAND:funmkad(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!AdminInfo[playerid][aMakeAdmin]) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,admin,string[200];
	    if(sscanf(params,"ud",id,admin)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /makeadmin [id] [level (0 - 7)]");
	    if(IsPlayerConnected(id))
	    {
	        format(string,sizeof(string),"** Админ %s выдал вам %d-й уровень администратирования",PN(playerid),admin);
	        SendClientMessage(id,COLOR_LIGHTBLUE,string);
	        SendClientMessage(id,COLOR_LIGHTBLUE,"Чтобы пользоваться админкой вышлите 500 рублей на кошелек WebMoney {FF9900}R474159631990");
	        format(string,sizeof(string),"[Fun]Вы выдали игроку %s %d-й уровень администратирования",PN(id),admin);
	        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	    }
	}
	return true;
}

COMMAND:makehelper(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN || PlayerInfo[playerid][pHelper] >= 3)
	{
	    if(!AdminInfo[playerid][aMakeHelper] && PlayerInfo[playerid][pHelper] < 3) return SendClientMessage(playerid,COLOR_LIGHTRED,"Вы не имеете доступа с этой команде/функции");
	    if(!ADuty[playerid] && !PlayerInfo[playerid][pHelper]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200],rank;
	    if(sscanf(params,"ud",id,rank)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /makehelper [id] [ранг]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pAdmin] < ADM_MODER || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	        {
	            if(rank < 3 || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	            {
			        format(string,sizeof(string),"** Админ %s назначил вас хелпером %d-го уровня",PN(playerid),rank);
			        SendClientMessage(id,COLOR_LIGHTBLUE,string);
			        format(string,sizeof(string),"Вы назначили игрока %s хелпером %d-го уровня",PN(id),rank);
			        SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
			        format(string,sizeof(string),"** %s назначил игрока %s хелпером %d-го уровня",PN(playerid),PN(id),rank);
		        	WriteLog("MakeAdmin.log",string);
			        PlayerInfo[id][pHelper] = rank;
			        SetAdminLevel(id,0);
			        SaveAccount(id);
		        }
		        else SendClientMessage(playerid, COLOR_GREY, "Не более 2-го ранга");
	        }
	    }
	}
	return true;
}


COMMAND:asellbiz(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new biz;
	    if(sscanf(params,"d",biz)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используй: /asellbiz [bizid]");
	    SetString(BizInfo[biz][bOwner],"The State");
	   	SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы продали бизнес");
		UpdateBiz(biz);
		SaveBiz(biz);
	}
	return true;
}


COMMAND:tow(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_MECHANIC)
	{
	    if(GetPlayerState(playerid) == 2)
  		{
  		    new carid = GetPlayerVehicleID(playerid);
	    	if(GetVehicleModelEx(carid) == 525)
			{
			    if(IsTrailerAttachedToVehicle(carid))
			    {
					DetachTrailerFromVehicle(carid);
				}
				else
				{
				    for(new i = 1;i < ADD_VEHICLES;i ++)
				    {
				        new Float:X,Float:Y,Float:Z;
				        GetVehiclePos(i,X,Y,Z);
				        if(IsPlayerInRangeOfPoint(playerid,7.0,X,Y,Z) && i != carid)
						{
							AttachTrailerToVehicle(i,carid);
							break;
						}
						else continue;
				    }
			    }
			}
		}
	}
	return true;
}

COMMAND:refill(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_MECHANIC)
	{
	    if(PlayerInfo[playerid][pFuel])
	    {
	        if(RefillOffer[playerid] == INVALID_PLAYER_ID && RepairOffer[playerid] == INVALID_PLAYER_ID)
	        {
				if(!RepairReset[playerid])
			    {
				    new id, price, count, string[150];
				    if(sscanf(params,"udd",id,price,count)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /refill [id] [цена] [литры]");
					if(ProxDetectorS(4.0,playerid,id))
					{
					    if(RepairOffer[id] == INVALID_PLAYER_ID)
					    {
						    if(GetPlayerState(id) == PLAYER_STATE_DRIVER)
						    {
						        new carid = GetPlayerVehicleID(id);
						        if(!Filled[carid])
						        {
							        if(!IsAVelik(carid))
							        {
								        if(Fuel[carid] < 100.0)
								        {
								            if(Fuel[carid] + float(count) <= 100.0)
								            {
										        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
										        {
										            if(price > 0)
										            {
														if(price > 200) return SendClientMessage(playerid,COLOR_GREY,"За свои услуги вы можете брать не более $200");
										            	format(string,sizeof(string),"{FFFFFF}Механик {10F441}%s {FFFFFF}предлагает вам заправить ваш транспорт.\nЛитры: %dл\nСтоимость: {10F441}$%d",cPN(playerid), count, price);
								                        if(!ShowPlayerDialogEx(id,76,0,"Заправка",string,"Заправить","Отмена"))
								                        {
								                            SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
								                        }
								                        else
								                        {
															format(string,sizeof(string),"Вы хотите заправить транспорт игроку %s на %dл за $%d",cPN(id), count, price);
															SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
											            	RefillOffer[playerid] = id;
											            	RefillOffer[id] = playerid;
											            	RefillPrice[id] = price;
											            	RefillCount[id] = float(count);
										            	}
													}
													else SendClientMessage(playerid,COLOR_GREY,"Не меньше $1");
										        }
										        else SendClientMessage(playerid,COLOR_GREY,"Вы должны находиться вне транспорта");
											}
											else
											{
											    format(string,sizeof(string),"В бак столько не вместится! Максимум %.0fл", 100.0 - Fuel[carid]);
												SendClientMessage(playerid,COLOR_GREY,string);
											}
										}
								        else SendClientMessage(playerid,COLOR_GREY,"В этом транспорте достаточно топлива");
							        }
						        	else SendClientMessage(playerid,COLOR_GREY,"Нельзя заправлять данный вид транспорта");
								}
								else SendClientMessage(playerid,COLOR_GREY,"Транспортное средство уже заправляется");
							}
						    else SendClientMessage(playerid,COLOR_GREY,"Игрок должен сидеть в транспорте");
						}
						else SendClientMessage(playerid,COLOR_GREY,"Этого игрока уже заправляют");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Вы далеко от игрока");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Вы можете чинить,заправлять,устанавливать неон/сигнализцию только 1 раз в 30 секунд");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Вы уже кого-то заправляете/чините");
		}
		else SendClientMessage(playerid,COLOR_GREY,"У вас нет канистры чтобы заправить транспорт");
	}
	return true;
}

/*
COMMAND:gototp(playerid, p[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id;
		sscanf(p, "d", id);
		SetPlayerInterior(playerid, TeleportInfo[id][tpEnterInt]);
		SetPlayerVirtualWorld(playerid, TeleportInfo[id][tpEnterWorld]);
		SetPlayerPos(playerid, TeleportInfo[id][tpEnterPos_X], TeleportInfo[id][tpEnterPos_Y], TeleportInfo[id][tpEnterPos_Z]);
	}
	return true;
}
*/
COMMAND:repcar(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    if(PlayerInfo[playerid][pRepPack])
	    {
	        new Float:X, Float:Y, Float:Z, Float:Distance;
	        new carid = GetPlayerMustNearCar(playerid, X, Y, Z, Distance);
	        if(carid != INVALID_VEHICLE_ID && Distance < 2.0)
	        {
		        new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
		    	if(angle >= -45 && angle <= 45)
				{
				    new Float:Health;
				    GetVehicleHealth(carid, Health);
				    if(Health < 1000.0)
				    {
				        new string[100];
						if(GetPlayerPing(playerid) > 170)
						{
						    SendClientMessage(playerid, COLOR_GREY, "(( У вас слишком большой пинг. Возможна рассинхронизация ХП транспорта ))");
						}
					    format(string, sizeof(string), "* %s начинает чинить транспорт с помощью набора", cPN(playerid));
					    ProxDetector(15.0, playerid, string, COLOR_PURPLE);
					    SetTimerEx("PlayerRepairVehicle", 250, false, "iif", playerid, carid, Health + 15.0);
				    }
				    else SendClientMessage(playerid, COLOR_GREY, "Двигатель этого транспорта не поврежден");
				}
				else SendClientMessage(playerid, COLOR_GREY, "Вы должны быть повернуты лицом к транспорту");
			}
			else SendClientMessage(playerid, COLOR_GREY, "Вы должны находиться рядом с транспортом");
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "У вас нет набора для починки транспорта");
    }
    else SendClientMessage(playerid, COLOR_GREY, "Вы должны находиться вне транспорта");
    return true;
}

COMMAND:repair(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_MECHANIC)
	{
		if(RefillOffer[playerid] == INVALID_PLAYER_ID && RepairOffer[playerid] == INVALID_PLAYER_ID)
		{
		    if(PlayerInfo[playerid][pPasatizhi])
		    {
			    if(!RepairReset[playerid])
			    {
				    new id, part, price, string[150], Float:X, Float:Y[2], Float:Z, rname[30];
				    if(sscanf(params,"uii", id, part, price) || part < 1 || part > 5)
					{
						SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /repair [ID/Имя] [ID части транспорта] [Цена]");
						SendClientMessage(playerid,COLOR_WHITE,"__________ Список доступных ID's __________");
						SendClientMessage(playerid,COLOR_WHITE,"1. Двигатель");
						SendClientMessage(playerid,COLOR_WHITE,"2. Панель");
						SendClientMessage(playerid,COLOR_WHITE,"3. Двери");
						SendClientMessage(playerid,COLOR_WHITE,"4. Фары");
						SendClientMessage(playerid,COLOR_WHITE,"5. Колеса");
						SendClientMessage(playerid,COLOR_WHITE,"____________________________________________");
						return true;
					}
					switch(part)
					{
					    case 1: rname = "починить двигатель";
					    case 2: rname = "отремонтировать панель";
					    case 3: rname = "отремонтировать двери";
                        case 4: rname = "отремонтировать фары";
                        case 5: rname = "заменить колеса";
					}
					if(RepairOffer[id] == INVALID_PLAYER_ID)
					{
						if(GetPlayerState(id) == PLAYER_STATE_DRIVER)
						{
							if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
						    {
							    if(price > 0)
			        			{
			        				new carid = GetPlayerVehicleID(id);
			        				GetVehicleModelInfo(GetVehicleModel(carid), VEHICLE_MODEL_INFO_SIZE, X, Y[1], Z);
									GetVehicleShiftPos( carid, 0, X, Y[0], Z, Y[1] / 2 );
									if(IsPlayerInRangeOfPoint( playerid, 1.0, X, Y[0], Z ) )
									{
										if(price > 200) return SendClientMessage(playerid,COLOR_GREY,"За свои услуги вы можете брать не более $200");
								    	format(string,sizeof(string),"{FFFFFF}Механик {10F441}%s {FFFFFF}предлагает вам %s.\nСтоимость: {10F441}$%d",cPN(playerid), rname, price);
								    	if(!ShowPlayerDialogEx(id,75,0,"Починка",string,"Починить","Отмена"))
								    	{
								    	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
								    	}
								    	else
								    	{
									    	format(string,sizeof(string),"Вы хотите %s транспорта игроку %s за $%d",cPN(id), rname, price);
									    	SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
									    	RepairOffer[playerid] = id;
									    	RepairOffer[id] = playerid;
									    	RepairPrice[id] = price;
									    	RepairPart[id] = part;
								    	}
							        }
							        else SendClientMessage(playerid,COLOR_GREY,"Вы далеко от транспорта");
								}
						        else SendClientMessage(playerid,COLOR_GREY,"Цена должна быть от $1 до $200");
						    }
						    else SendClientMessage(playerid,COLOR_GREY,"Вы должны быть вне транспорта.");
						}
						else SendClientMessage(playerid,COLOR_GREY,"Игрок должен сидеть в транспорте.");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Этому игроку уже поступило предложение о починке.");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Вы можете чинить,заправлять,устанавливать неон/сигнализцию только 1 раз в 30 секунд");
			}
			else SendClientMessage(playerid,COLOR_GREY,"У вас нет гаечного ключа, чтобы чинить транспорт");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы уже кого-то чините/заправляете");
	}
	return true;
}

COMMAND:gotaxi(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_TAXI)
	{
	    new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /gotaxi [id]");
	    if(IsPlayerConnected(id))
	    {
	        if(TaxiON[id])
	        {
	            new string[100];
	            format(string,sizeof(string),"Таксист %s принял ваш заказ, ждите",PN(playerid));
	            SendClientMessage(id,COLOR_LIGHTBLUE,string);
	            format(string,sizeof(string),"Игрок %s отмечен на карте",PN(id));
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	            new Float:X,Float:Y,Float:Z;
	            GetPlayerPos(id,X,Y,Z);
	            EnableGPSForPlayer(playerid,X,Y,Z);
	            TaxiON[id] = false;
	            format(string,sizeof(string),"Таксист %s принял вызов игрока %s",PN(playerid),PN(id));
				for(new i;i < GetMaxPlayersEx();i ++)
				{
				    if(!IsPlayerConnected(i)) continue;
				    if(PlayerInfo[i][pJob] == JOB_TAXI) SendClientMessage(i,COLOR_LIGHTBLUE,string);
				}
	        }
	        else
	        {
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,"Этот игрок не заказывал такси либо его заказ уже приняли");
	        }
	    }
	}
	return true;
}

COMMAND:gomechanic(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_MECHANIC)
	{
	    new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /gomechanic [id]");
	    if(IsPlayerConnected(id))
	    {
	        if(MehanON[id])
	        {
	            new string[100];
	            format(string,sizeof(string),"Механик %s принял ваш заказ, ждите",PN(playerid));
	            SendClientMessage(id,COLOR_LIGHTBLUE,string);
	            format(string,sizeof(string),"Игрок %s отмечен на карте",PN(id));
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	            new Float:X,Float:Y,Float:Z;
	            GetPlayerPos(id,X,Y,Z);
	            EnableGPSForPlayer(playerid,X,Y,Z);
	            MehanON[id] = false;
	            format(string,sizeof(string),"Механик %s принял вызов игрока %s",PN(playerid),PN(id));
				for(new i;i < GetMaxPlayersEx();i ++)
				{
				    if(!IsPlayerConnected(i)) continue;
				    if(PlayerInfo[i][pJob] == JOB_MECHANIC) SendClientMessage(i,COLOR_LIGHTBLUE,string);
				}
	        }
	        else
	        {
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,"Этот игрок не вызывал механика либо его заказ уже приняли");
	        }
	    }
	}
	return true;
}

COMMAND:gomedik(playerid, params[])
{
	if(GetTeamID(playerid) == TEAM_M4C)
	{
	    new id;
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /gomedik [id]");
	    if(IsPlayerConnected(id))
	    {
	        if(MedikON[id])
	        {
	            new string[100];
	            format(string,sizeof(string),"Медик %s принял ваш заказ, ждите",PN(playerid));
	            SendClientMessage(id,COLOR_LIGHTBLUE,string);
	            format(string,sizeof(string),"Игрок %s отмечен на карте",PN(id));
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	            new Float:X,Float:Y,Float:Z;
	            GetPlayerPos(id,X,Y,Z);
	            EnableGPSForPlayer(playerid,X,Y,Z);
	            MedikON[id] = false;
	            format(string,sizeof(string),"Медик %s принял вызов игрока %s",PN(playerid),PN(id));
				for(new i;i < GetMaxPlayersEx();i ++)
				{
				    if(!IsPlayerConnected(i)) continue;
				    if(GetTeamID(i) == TEAM_M4C) SendClientMessage(i,COLOR_LIGHTBLUE,string);
				}
	        }
	        else
	        {
	            SendClientMessage(playerid,COLOR_LIGHTBLUE,"Этот игрок не вызывал скорую помощь либо его заказ уже приняли");
	        }
	    }
	}
	return true;
}

COMMAND:gps(playerid, params[])
{
    AtMenu[playerid] = false;
	return ShowGPS(playerid);
}
COMMAND:donate(playerid, params[])
{
	AtMenu[playerid] = false;
	return ShowDonate(playerid);
}

COMMAND:givemats(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givemats [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pMats])
		        {
		            if(PlayerInfo[giveplayerid][pMats] + count > 2000) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не сможет унести с собой более 2000 материалов");
					PlayerInfo[playerid][pMats] -= count;
				    PlayerInfo[giveplayerid][pMats] += count;
		   			format(string,sizeof(string),"Игрок %s передал материалы в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d материалов",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d материалов игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько материалов");
		    }
		}
	}
	return true;
}

COMMAND:givedrugs(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givedrugs [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pDrugs])
		        {
					PlayerInfo[playerid][pDrugs] -= count;
				    PlayerInfo[giveplayerid][pDrugs] += count;
		   			format(string,sizeof(string),"Игрок %s передал наркотики в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d наркотиков",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d наркотиков игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько наркотиков");
		    }
		}
	}
	return true;
}

COMMAND:givesigs(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givesigs [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pSigs])
		        {
					PlayerInfo[playerid][pSigs] -= count;
				    PlayerInfo[giveplayerid][pSigs] += count;
		   			format(string,sizeof(string),"Игрок %s передал сигареты в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d сигарет",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d сигарет игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько сигарет");
		    }
		}
	}
	return true;
}

COMMAND:givecheeps(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givecheeps [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        new cheeps = PlayerInfo[playerid][pCheeps];
		        new allcheeps = PlayerInfo[playerid][pCheeps] + PlayerInfo[playerid][pCheepses];
		        if(count > 0 && count <= allcheeps)
		        {
		            if(cheeps < count)
		            {
		                PlayerInfo[playerid][pCheeps] = 0;
		                PlayerInfo[playerid][pCheepses] -= (count - cheeps);
		            }
		            else PlayerInfo[playerid][pCheeps] -= count;
		            PlayerInfo[giveplayerid][pCheeps] += count;
		   			format(string,sizeof(string),"Игрок %s передал чипсы в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d пачек чипсов",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d пачек чипсов игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько чипсов");
		    }
		}
	}
	return true;
}

COMMAND:givesprunk(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givesprunk [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        new sprunk = PlayerInfo[playerid][pSprunk];
		        new allsprunk = PlayerInfo[playerid][pSprunk] + PlayerInfo[playerid][pSprunks];
		        if(count > 0 && count <= allsprunk)
		        {
		            if(sprunk < count)
		            {
		                PlayerInfo[playerid][pSprunk] = 0;
		                PlayerInfo[playerid][pSprunks] -= (count - sprunk);
		            }
		            else PlayerInfo[playerid][pSprunk] -= count;
		            PlayerInfo[giveplayerid][pSprunk] += count;
		   			format(string,sizeof(string),"Игрок %s передал спранк в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d банок спранка",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d банок спранка игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько спранка");
		    }
		}
	}
	return true;
}

COMMAND:givebeer(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givebeer [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        new beer = PlayerInfo[playerid][pBeer];
		        new allbeer = PlayerInfo[playerid][pBeer] + PlayerInfo[playerid][pBeers];
		        if(count > 0 && count <= allbeer)
		        {
		            if(beer < count)
		            {
		                PlayerInfo[playerid][pBeer] = 0;
		                PlayerInfo[playerid][pBeers] -= (count - beer);
		            }
		            else PlayerInfo[playerid][pBeer] -= count;
		            PlayerInfo[giveplayerid][pBeer] += count;
		   			format(string,sizeof(string),"Игрок %s передал пиво в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d бутылок пива",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d бутылок пива игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько пива");
		    }
		}
	}
	return true;
}

COMMAND:givegold(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givegold [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pGold])
		        {
		            PlayerInfo[playerid][pGold] -= count;
		            PlayerInfo[giveplayerid][pGold] += count;
		   			format(string,sizeof(string),"Игрок %s передал золото в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %dг золота",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %dг золота игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько золота");
		    }
		}
	}
	return true;
}

COMMAND:giveworms(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givegold [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pGold])
		        {
		            PlayerInfo[playerid][pWorms] -= count;
		            PlayerInfo[giveplayerid][pWorms] += count;
		   			format(string,sizeof(string),"Игрок %s передал червей в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d червей",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d червей игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько червей");
		    }
		}
	}
	return true;
}

COMMAND:givesyringe(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givesyringe [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pSyringe])
		        {
		            PlayerInfo[playerid][pSyringe] -= count;
		            PlayerInfo[giveplayerid][pSyringe] += count;
		   			format(string,sizeof(string),"Игрок %s передал шприцы в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d шприцов",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d шприцов игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько шприцов");
		    }
		}
	}
	return true;
}

COMMAND:givepoison(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givepoison [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pPoison])
		        {
		            PlayerInfo[playerid][pPoison] -= count;
		            PlayerInfo[giveplayerid][pPoison] += count;
		   			format(string,sizeof(string),"Игрок %s передал яд в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d доз яда",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d доз яда игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько яда");
		    }
		}
	}
	return true;
}

COMMAND:giveclip(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, count, string[100];
	    if(sscanf(params, "ud", giveplayerid, count)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giveclip [ID/Name] [Кол-во]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(count > 0 && count <= PlayerInfo[playerid][pClip])
		        {
		            PlayerInfo[playerid][pClip] -= count;
		            PlayerInfo[giveplayerid][pClip] += count;
		   			format(string,sizeof(string),"Игрок %s передал скрепки в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам %d скрепок",cPN(playerid),count);
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали %d скрепок игроку %s",count,cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет столько скрепок");
		    }
		}
	}
	return true;
}

COMMAND:givemask(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givemask [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pMask])
		        {
		            if(PlayerInfo[giveplayerid][pMask]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть маска");
		            if(PlayerInfo[playerid][pMaskON]) cmd_mask(playerid, "");
		            PlayerInfo[giveplayerid][pMask] = PlayerInfo[playerid][pMask];
		            PlayerInfo[playerid][pMask] = 0;
		   			format(string,sizeof(string),"Игрок %s передал маску в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам маску",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали маску игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет маски");
		    }
		}
	}
	return true;
}

COMMAND:giveshlem(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giveshlem [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pShlem])
		        {
		            if(PlayerInfo[giveplayerid][pShlem]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть шлем");
		            PlayerInfo[giveplayerid][pShlem] = PlayerInfo[playerid][pShlem];
		            PlayerInfo[playerid][pShlem] = 0;
		   			format(string,sizeof(string),"Игрок %s передал шлем в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам шлем",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали шлем игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет шлема");
		    }
		}
	}
	return true;
}

COMMAND:givefw(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givefw [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pFireWorks])
		        {
		            if(PlayerInfo[giveplayerid][pFireWorks]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть фейерверк");
		            PlayerInfo[giveplayerid][pFireWorks] = PlayerInfo[playerid][pFireWorks];
		            PlayerInfo[playerid][pFireWorks] = 0;
		   			format(string,sizeof(string),"Игрок %s передал фейерверк в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам фейерверк",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали фейерверк игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет фейерверка");
		    }
		}
	}
	return true;
}

COMMAND:givespining(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givespining [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pSpining])
		        {
		            if(PlayerInfo[giveplayerid][pSpining]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть спининг");
		            PlayerInfo[giveplayerid][pSpining] = PlayerInfo[playerid][pSpining];
		            PlayerInfo[playerid][pSpining] = 0;
		   			format(string,sizeof(string),"Игрок %s передал спининг в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам спининг",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали спининг игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет спининга");
		    }
		}
	}
	return true;
}

COMMAND:givefinder(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givefinder [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pFeFinder])
		        {
		            if(PlayerInfo[giveplayerid][pFeFinder]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть мтеллоискатель");
		            PlayerInfo[giveplayerid][pFeFinder] = PlayerInfo[playerid][pFeFinder];
		            PlayerInfo[playerid][pFeFinder] = 0;
		   			format(string,sizeof(string),"Игрок %s передал мтеллоискатель в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам мтеллоискатель",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали металлоискатель игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет мтеллоискателя");
		    }
		}
	}
	return true;
}

COMMAND:givebp(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givebp [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pPack])
		        {
		            if(PlayerInfo[giveplayerid][pPack]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть рюкзак");
		            PlayerInfo[giveplayerid][pPack] = PlayerInfo[playerid][pPack];
		            PlayerInfo[playerid][pPack] = 0;
		            PlayerInfo[giveplayerid][pCheepses] = PlayerInfo[playerid][pCheepses];
		            PlayerInfo[playerid][pCheepses] = 0;
		            PlayerInfo[giveplayerid][pSprunks] = PlayerInfo[playerid][pSprunks];
		            PlayerInfo[playerid][pSprunks] = 0;
		            PlayerInfo[giveplayerid][pBeers] = PlayerInfo[playerid][pBeers];
		            PlayerInfo[playerid][pBeers] = 0;
		   			format(string,sizeof(string),"Игрок %s передал рюкзак в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам рюкзак",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали рюкзак игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет рюкзака");
		    }
		}
	}
	return true;
}

COMMAND:givebook(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givebook [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pPhoneBook])
		        {
		            if(PlayerInfo[giveplayerid][pPhoneBook]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть телефонная книга");
		            PlayerInfo[giveplayerid][pPhoneBook] = PlayerInfo[playerid][pPhoneBook];
		            PlayerInfo[playerid][pPhoneBook] = 0;
		   			format(string,sizeof(string),"Игрок %s передал телефонную книгу в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам телефонную книгу",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали телефонную книгу игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет телефенной книги");
		    }
		}
	}
	return true;
}

COMMAND:giveglasses(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giveglasses [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pGlasses])
		        {
		            if(PlayerInfo[giveplayerid][pGlasses]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть очки");
		            PlayerInfo[giveplayerid][pGlasses] = PlayerInfo[playerid][pGlasses];
		            PlayerInfo[playerid][pGlasses] = 0;
		   			format(string,sizeof(string),"Игрок %s передал набор очков в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам набор очков",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали набор очков игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет очков");
		    }
		}
	}
	return true;
}

COMMAND:givehats(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givehats [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pHats])
		        {
		            if(PlayerInfo[giveplayerid][pHats]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть шляпы");
		            PlayerInfo[giveplayerid][pHats] = PlayerInfo[playerid][pHats];
		            PlayerInfo[playerid][pHats] = 0;
		   			format(string,sizeof(string),"Игрок %s передал набор шляп в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам набор шляп",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали набор шляп игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет шляп");
		    }
		}
	}
	return true;
}

COMMAND:givebandans(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givebandans [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pBandans])
		        {
		            if(PlayerInfo[giveplayerid][pBandans]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть банданы");
		            PlayerInfo[giveplayerid][pBandans] = PlayerInfo[playerid][pBandans];
		            PlayerInfo[playerid][pBandans] = 0;
		   			format(string,sizeof(string),"Игрок %s передал набор бандан в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам набор бандан",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали набор бандан игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет бандан");
		    }
		}
	}
	return true;
}

COMMAND:givelighter(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givelighter [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pLighter])
		        {
		            if(PlayerInfo[giveplayerid][pLighter]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть зажигалка");
		            PlayerInfo[giveplayerid][pLighter] = PlayerInfo[playerid][pLighter];
		            PlayerInfo[playerid][pLighter] = 0;
		   			format(string,sizeof(string),"Игрок %s передал зажигалку в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам зажигалку",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали зажигалку игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет зажигалки");
		    }
		}
	}
	return true;
}

COMMAND:givescrew(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givescrew [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pScrew])
		        {
		            if(PlayerInfo[giveplayerid][pScrew]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть отвертка");
		            PlayerInfo[giveplayerid][pScrew] = PlayerInfo[playerid][pScrew];
		            PlayerInfo[playerid][pScrew] = 0;
		   			format(string,sizeof(string),"Игрок %s передал отвертку в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам отвертку",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали отвертку игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет отвертки");
		    }
		}
	}
	return true;
}

COMMAND:giveradio(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giveradio [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pRadio])
		        {
		            if(PlayerInfo[giveplayerid][pRadio]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть радио");
		            PlayerInfo[giveplayerid][pRadio] = PlayerInfo[playerid][pRadio];
		            PlayerInfo[playerid][pRadio] = 0;
		   			format(string,sizeof(string),"Игрок %s передал радио в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам радио",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали радио игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет радио");
		    }
		}
	}
	return true;
}

COMMAND:giveroliki(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giveroliki [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pRoliki])
		        {
		            if(PlayerInfo[giveplayerid][pRoliki]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть ролики");
		            PlayerInfo[giveplayerid][pRoliki] = PlayerInfo[playerid][pRoliki];
		            PlayerInfo[playerid][pRoliki] = 0;
		   			format(string,sizeof(string),"Игрок %s передал ролики в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам ролики",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали ролики игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет роликов");
		    }
		}
	}
	return true;
}

COMMAND:givepasatizhi(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givepasatizhi [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pPasatizhi])
		        {
		            if(PlayerInfo[giveplayerid][pPasatizhi]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть гаечный ключ");
		            PlayerInfo[giveplayerid][pPasatizhi] = PlayerInfo[playerid][pPasatizhi];
		            PlayerInfo[playerid][pPasatizhi] = 0;
		   			format(string,sizeof(string),"Игрок %s передал гаечный ключ в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам гаечный ключ",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали гаечный ключ игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет гаечного ключа");
		    }
		}
	}
	return true;
}

COMMAND:givefuel(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /givefuel [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pFuel])
		        {
		            if(PlayerInfo[giveplayerid][pFuel]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть канистра");
		            PlayerInfo[giveplayerid][pFuel] = PlayerInfo[playerid][pFuel];
		            PlayerInfo[playerid][pFuel] = 0;
		   			format(string,sizeof(string),"Игрок %s передал канистру в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам канистру",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали канистру игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет канистры");
		    }
		}
	}
	return true;
}

COMMAND:giverope(playerid, params[])
{
    if(IsPlayerConnected(playerid))
	{
	    new giveplayerid, string[100];
	    if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Используй: /giverope [ID/Name]");
		if(IsPlayerConnected(giveplayerid) && IsPlayerLogged[giveplayerid])
		{
		    if(ProxDetectorS(3.0, giveplayerid, playerid))
		    {
		        if(PlayerInfo[playerid][pRope])
		        {
		            if(PlayerInfo[giveplayerid][pRope]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока уже есть веревка");
		            PlayerInfo[giveplayerid][pRope] = PlayerInfo[playerid][pRope];
		            PlayerInfo[playerid][pRope] = 0;
		   			format(string,sizeof(string),"Игрок %s передал веревку в руки игрока %s",cPN(playerid),cPN(giveplayerid));
		   			ProxDetector(15.0, playerid, string, COLOR_PURPLE);
				    format(string,sizeof(string),"Игрок %s передал вам веревку",cPN(playerid));
				    SendClientMessage(giveplayerid,COLOR_GREY,string);
				    format(string,sizeof(string),"Вы передали веревку игроку %s",cPN(giveplayerid));
				    SendClientMessage(playerid,COLOR_GREY,string);
				    SaveAccount(playerid);
				    SaveAccount(giveplayerid);
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "У вас нет веревки");
		    }
		}
	}
	return true;
}

COMMAND:find(playerid, params[])
{
    if(PlayerInfo[playerid][pJob] == JOB_DETECTIVE)
	{
	    new carid = GetPlayerVehicleID(playerid);
	    new number, Float:X, Float:Y, Float:Z;
	  	if(sscanf(params,"i",number)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /find [Номер телефона]");
		for(new i; i < GetMaxPlayersEx(); i ++)
		{
		    if(IsPlayerConnected(i) && IsPlayerLogged[i])
		    {
				if(PlayerInfo[i][pTelNum] == number)
				{
				    if(AfterCallTime[i] || PlayerSayer[i] != INVALID_PLAYER_ID)
				    {
						if(IsPlayerInAnyVehicle(playerid) && IsACopCar(carid))
						{
					  		FindPlayer[playerid] = i;
					  		SendClientMessage(playerid, COLOR_LIME, "Объект появится на карте как только будет в зоне доступа.");
					  		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Используйте /findoff чтобы прекратить слежение.");
					    }
					    else if(IsPlayerInRangeOfPoint(playerid, 2.0, -358.79998779,1593.90002441,76.90000153) && IsACop(playerid))
					    {
					        GetPlayerPos(i, X, Y, Z);
					  		EnableGPSForPlayer(playerid, X, Y, Z);
					  		SendClientMessage(playerid, COLOR_LIME, "Объект отмечен на карте желтым маркером");
					    }
					    else SendClientMessage(playerid, COLOR_GREY, "Вы должны быть либо в транспорте либо на базе ЦРУ");
				    }
				    else SendClientMessage(playerid, COLOR_GREY, "С этого номера небыло сигналов за последние 2 минуты");
				    return true;
				}
			}
		}
		SendClientMessage(playerid, COLOR_GREY, "Данного номера не существует");
	}
	return true;
}

COMMAND:findoff(playerid, params[])
{
	if(FindPlayer[playerid] != INVALID_PLAYER_ID)
	{
	    RemovePlayerMapIcon(playerid, 99);
	    FindPlayer[playerid] = INVALID_PLAYER_ID;
	}
	return true;
}

COMMAND:rob(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_THEIF)
	{
	    if(TheifRobID[playerid] == INVALID_PLAYER_ID)
	    {
			new id;
			if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /rob [ID игрока]");
			if(ProxDetectorS(1.0, playerid, id) && id != playerid)
			{
			    if(!IsPlayerInAnyVehicle(id))
			    {
					new Float:A,Float:A2;
					GetPlayerFacingAngle(playerid, A);
					GetPlayerFacingAngle(id, A2);
					if( (40) > (A-A2) > (-40) )
					{
					    CheckRobBank(playerid);
				        CheckTheftCar(playerid);
				        CheckMiner(playerid);
				        CheckRobPlayer(playerid);
				        CheckBreakCuff(playerid);
				        TheifRobID[playerid] = id;
					    SetPlayerRandomKey(playerid, TheifKey[playerid], false);
					    J_TogglePlayerControllable(playerid, false);
					    ShowPlayerActionBand(playerid, 0, 8);
					}
					else SendClientMessage(playerid, COLOR_GREY, "Подойдите к игроку сзади чтобы ограбить его");
				}
			}
		}
	}
	return true;
}

COMMAND:poison(playerid, params[])
{
	if(PlayerInfo[playerid][pPoison] > 0 && PlayerInfo[playerid][pSyringe] > 0)
	{
		if(PoisonID[playerid] == INVALID_PLAYER_ID)
	 	{
			new id, string[150];
			if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /poison [ID игрока]");
			if(ProxDetectorS(1.0, playerid, id) && id != playerid)
			{
			    if(!NoPlayerDM[playerid] && !NoPlayerDM[id])
			    {
		  			if(!IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(id))
		  			{
		  			    if(!Knockout[id] && !Cuffed[id] && !CuffedTime[id] && Controllable[id])
		  			    {
							new Float:A,Float:A2;
							GetPlayerFacingAngle(playerid, A);
							GetPlayerFacingAngle(id, A2);
							if( (40) > (A-A2) > (-40) )
							{
							    new Key[30];
							  	J_TogglePlayerControllable(id, false);
							  	J_TogglePlayerControllable(playerid, false);
							  	SetPlayerRandomKey(id, UnPoisonKey[id], true);
							  	GetTextKeyName(UnPoisonKey[id], Key);
							  	ShowPlayerActionBand(id, 0, 10);
							  	UnPoisonCount[id] = 0;
							  	format(string, sizeof(string),"Игрок %s пытается уколоть вас! Нажимайте %s чтобы увернуться.", cPN(playerid), Key);
							  	SendClientMessage(id, COLOR_LIGHTRED, string);
							  	format(string, sizeof(string),"Вы пытаетесь уколоть игрока %s", PN(id));
							  	SendClientMessage(playerid, COLOR_LIGHTRED, string);
							  	ApplyAnimation(playerid, "KNIFE", "KILL_PARTIAL", 4.1, 0, 1, 1, 0, 5000, 1);
							  	PlayerInfo[playerid][pPoison] --;
							  	PlayerInfo[playerid][pSyringe] --;
							  	PoisonID[playerid] = id;
							  	PoisonID[id] = playerid;
							  	PoisonTime[id] = 4;
							}
							else SendClientMessage(playerid, COLOR_GREY, "Подойдите к игроку сзади чтобы отравить его");
						}
						else SendClientMessage(playerid, COLOR_GREY, "Игрок уже обездвижен");
					}
					else SendClientMessage(playerid, COLOR_GREY, "И вы и игрок доллжны находится вне транспорта");
				}
				else SendClientMessage(playerid, COLOR_GREY, "Игрок либо вы находитесь в Анти-ДМ зоне");
			}
			else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы уже кого-то отравляете либо кто-то отравляет вас");
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREY, "У вас нет яда либо шприца.");
	}
	return true;
}

COMMAND:blindfold(playerid, params[])
{
	new id, string[150];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /blindfold [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			if(Knockout[id] && KnockoutTick[id] == 0)
			{
			    format(string, sizeof(string),"Игрок %s завязал глаза игроку %s!", cPN(playerid), cPN(id));
			    if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
			    else SendVehicleMessage(carid, COLOR_PURPLE, string);
			  	format(string, sizeof(string),"Игрок %s завязал вам глаза!", cPN(playerid));
			  	SendClientMessage(id, COLOR_LIGHTRED, string);
			  	format(string, sizeof(string),"Вы завязали глаза игроку %s", PN(id));
			  	SendClientMessage(playerid, COLOR_LIGHTRED, string);
				GangZoneShowForPlayer(id, HideMapZone, 0x000000FF);
				SetPlayerCameraPos(id, -1795.0, 1735.0, -99.0);
				SetPlayerCameraLookAt(id, -1795.7684, 1735.3344, -100.0);
				TogglePlayerMap(id, false);
		  	}
		  	else SendClientMessage(playerid, COLOR_GREY, "Сначала нужно отправить в нокаут или отравить игрока");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

COMMAND:unblindfold(playerid, params[])
{
	new id, string[150], Float:X, Float:Y, Float:Z;
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /unblindfold [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			GetPlayerCameraPos(id, X, Y, Z);
			if(X == -1795 && Y == 1735 && Z == -99)
			{
			    format(string, sizeof(string),"Игрок %s развязал глаза игроку %s!", cPN(playerid), cPN(id));
			    if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
			    else SendVehicleMessage(carid, COLOR_PURPLE, string);
				format(string, sizeof(string),"Игрок %s развязал вам глаза!", cPN(playerid));
				SendClientMessage(id, COLOR_LIGHTRED, string);
			  	format(string, sizeof(string),"Вы завязали глаза игроку %s", PN(id));
			  	SendClientMessage(playerid, COLOR_LIGHTRED, string);
				GangZoneHideForPlayer(id, HideMapZone);
				SetCameraBehindPlayer(id);
		  	}
		  	else SendClientMessage(playerid, COLOR_GREY, "У этого игрока не завязаны глаза");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

COMMAND:gag(playerid, params[])
{
	new id, string[150];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /gag [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			if( (Knockout[id]) == (!KnockoutTick[id]) )
			{
			    if(Gag[id]) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок уже с кляпом во рту.");
			    format(string, sizeof(string),"Игрок %s засунул кляп в рот игроку %s!", cPN(playerid), cPN(id));
			    if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
			    else SendVehicleMessage(carid, COLOR_PURPLE, string);
			  	format(string, sizeof(string),"Игрок %s засунул кляп вам в рот!", cPN(playerid));
			  	SendClientMessage(id, COLOR_LIGHTRED, string);
			  	format(string, sizeof(string),"Вы засунули игроку %s кляп в рот.", PN(id));
			  	SendClientMessage(playerid, COLOR_LIGHTRED, string);
				Gag[id] = true;
		  	}
		  	else SendClientMessage(playerid, COLOR_GREY, "Сначала нужно отправить в нокаут или отравить игрока");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

COMMAND:ungag(playerid, params[])
{
	new id, string[150];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /gag [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			if(!Gag[id]) return SendClientMessage(playerid, COLOR_GREY, "У этого игрока нет кляпа во рту.");
			format(string, sizeof(string),"Игрок %s высунул кляп изо рта игрока %s!", cPN(playerid), cPN(id));
			if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
  			else SendVehicleMessage(carid, COLOR_PURPLE, string);
 			format(string, sizeof(string),"Игрок %s высунул кляп вам изо рта!", cPN(playerid));
 			SendClientMessage(id, COLOR_LIGHTRED, string);
 			format(string, sizeof(string),"Вы высунули кляп изо рта игрока %s.", PN(id));
 			SendClientMessage(playerid, COLOR_LIGHTRED, string);
			Gag[id] = false;
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

COMMAND:ungagme(playerid, params[])
{
	new string[70];
	if(!Knockout[playerid] && !KnockoutTick[playerid])
	{
	    new carid = GetPlayerVehicleID(playerid);
 		if(!Gag[playerid]) return SendClientMessage(playerid, COLOR_GREY, "У вас нет кляпа во рту.");
 		format(string, sizeof(string),"Игрок %s высунул кляп!", cPN(playerid));
 		if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
 		else SendVehicleMessage(carid, COLOR_PURPLE, string);
		SendClientMessage(playerid, COLOR_LIGHTRED, "Вы высунули кляп изо рта.");
		Gag[playerid] = false;
	}
	return true;
}

COMMAND:tie(playerid, params[])
{
	new id, string[150];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /tie [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			if(Knockout[id] && KnockoutTick[id] > 0)
			{
			    if(!NoPlayerDM[playerid] && !NoPlayerDM[id])
				{
				    if(PlayerOfTie[playerid] == INVALID_PLAYER_ID)
				    {
        				if(PlayerOfTie[id] == INVALID_PLAYER_ID)
       					{
        					PlayerOfTie[playerid] = id;
					        PlayerOfTie[id] = playerid;
					        TimeOfTie[playerid] = 4;
					        format(string,sizeof(string),"* %s начинает связывать игрока %s",cPN(playerid),cPN(id));
					        if(!carid)
							{
								ProxDetector(15,playerid,string,COLOR_PURPLE);
					        	ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.1, 0, 1, 1, 1, 0, 1);
							}
							else SendVehicleMessage(carid, COLOR_PURPLE, string);
						}
						else
					    {
					     	SendClientMessage(playerid, COLOR_GREY, "Игрока уже связывают");
					  	}
				  	}
				 	else
				 	{
				     	SendClientMessage(playerid, COLOR_GREY, "Вы уже кого-то связываете");
				  	}
				}
				else SendClientMessage(playerid, COLOR_GREY, "Игрок либо вы находитесь в Анти-ДМ зоне");
		  	}
		  	else SendClientMessage(playerid, COLOR_GREY, "Сначала нужно отправить в нокаут или отравить игрока");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

COMMAND:untie(playerid, params[])
{
	new id, string[150];
	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /tie [ID игрока]");
	if(ProxDetectorS(1.5, playerid, id) && id != playerid)
	{
  		if(GetPlayerVehicleID(playerid) == GetPlayerVehicleID(id))
  		{
  		    new carid = GetPlayerVehicleID(playerid);
			if(Knockout[id] && KnockoutTick[id] == 0)
			{
			    format(string, sizeof(string),"Игрок %s развязал игрока %s!", cPN(playerid), cPN(id));
			    if(!carid) ProxDetector(15.0, playerid, string, COLOR_PURPLE);
			    else SendVehicleMessage(carid, COLOR_PURPLE, string);
			  	format(string, sizeof(string),"Игрок %s развязал вас!", cPN(playerid));
			  	SendClientMessage(id, COLOR_LIGHTRED, string);
			  	format(string, sizeof(string),"Вы развязали игрока %s", PN(id));
			  	SendClientMessage(playerid, COLOR_LIGHTRED, string);
				KnockoutTick[id] = 0;
				Knockout[id] = false;
				J_TogglePlayerControllable(id, true);
		  	}
		  	else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не связан");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы далеко от игрока");
	return true;
}

/*COMMAND:leaders(playerid, params[])
{
	new string[100];
	for(new i = 0;i < GetMaxPlayersEx(); i ++)
	{
	    if(IsPlayerConnected(i))
	    {
		    if(PlayerInfo[i][pLeader] > 0)
		    {
		        format(string,sizeof(string),"%s - %s[%i] | Тел: %d\n",TeamName(GetTeamID(i)),PN(i),i,PlayerInfo[i][pTelNum]);
		        SendClientMessage(playerid, COLOR_GREY, string);
		    }
	    }
	}
	return true;
}*/

COMMAND:licensers(playerid, params[])
{
	new string[100];
	for(new i = 0;i < GetMaxPlayersEx(); i ++)
	{
	    if(IsPlayerConnected(i))
	    {
		    if(GetTeamID(i) == TEAM_LICENSERS)
		    {
		        format(string,sizeof(string),"%s[%i] | Тел: %d\n",PN(i),i,PlayerInfo[i][pTelNum]);
		        SendClientMessage(playerid, COLOR_WHITE, string);
		    }
	    }
	}
	return true;
}

COMMAND:flist(playerid, params[])
{
	if(GetTeamID(playerid) > 0)
	{
		new string[70];
		for(new i = 0;i < GetMaxPlayersEx(); i ++)
		{
		    if(IsPlayerConnected(i))
		    {
	      		if(GetTeamID(i) == GetTeamID(playerid))
			    {
			        format(string,sizeof(string),"%s[%i] %s [Выговоров: %d]\n",PN(i),i,GetRankName(GetTeamID(i),PlayerInfo[i][pRank]), PlayerInfo[i][pFWarns]);
			        SendClientMessage(playerid, COLOR_WHITE, string);
			    }
		    }
		}
	}
	return true;
}

COMMAND:members(playerid, params[])
{
	return cmd_flist(playerid, params);
}

COMMAND:admins(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] > 0)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new string[50];
		for(new i = 0;i < GetMaxPlayersEx(); i ++)
		{
		    if(IsPlayerConnected(i))
		    {
			    if(PlayerInfo[i][pAdmin] > 0)
			    {
			        new Admin[20];
			        switch(PlayerInfo[i][pAdmin])
			        {
			            case ADM_MODER: Admin = "Модератор";
			            case ADM_SUPER_MODER: Admin = "Ст.Модератор";
			            case ADM_ADMIN: Admin = "Администратор";
			            case ADM_SUPER_ADMIN: Admin = "Ст.Администратор";
			            case ADM_GRAND_ADMIN: Admin = "Гл.Администратор";
			        }
			        format(string,sizeof(string),"%s %s[%i]\n",Admin,PN(i),i);
			        SendClientMessage(playerid, COLOR_GREY, string);
			    }
		    }
		}
	}
	return true;
}

COMMAND:helpers(playerid, params[])
{
	new string[35];
	for(new i = 0;i < GetMaxPlayersEx(); i ++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pHelper] > 0)
			{
				format(string,sizeof(string),"Хелпер %s",PN(i));
				SendClientMessage(playerid,COLOR_YELLOW,string);
			}
		}
	}
	return true;
}

COMMAND:hi(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessage(playerid, COLOR_GREY, "Нельзя использовать в машине");
			return true;
		}
		new id,string[200];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /hi [id]");
		if(IsPlayerConnected(id))
		{
			if(id != INVALID_PLAYER_ID)
			{
			    new Float:X, Float:Y, Float:Z;
			    GetPlayerPos(id, X, Y, Z);
			    new Float:distance = GetPlayerDistanceFromPoint(playerid, X, Y, Z);
				if( distance < 1.5 && distance > 0.5 )
				{
				    if(GetPlayerFaceToPlayer(playerid, id, 25.0))
				    {
				        if(GetPlayerFaceToPlayer(id, playerid, 25.0))
				        {
							new Float:angle;
							GetPlayerFacingAngle(playerid, angle);
							J_SetPlayerFacingAngle(id, angle + 180);
							format(string, sizeof(string), "* %s пожал(а) руку игроку %s", cPN(playerid),cPN(id));
							ProxDetector(10.0, playerid, string, COLOR_PURPLE);
							ApplyAnimation(playerid,"GANGS","hndshkfa",4.1, 0, 1, 1, 0, 0, 1);
							ApplyAnimation(id,"GANGS","hndshkfa",4.1, 0, 1, 1, 0, 0, 1);
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "Этот игрок не повернут к вам лицом");
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "Повернитесь лицом к игроку");
					}
					return true;
				}
				else if (distance < 20.0)
				{
					format(string,sizeof(string),"* %s машет рукой игроку %s",PN(playerid),PN(id));
					ProxDetector(25.0,playerid,string,COLOR_PURPLE);
					ApplyAnimation(playerid, "PED", "endchat_03", 4.1, 0, 1, 1, 0, 0, 1);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "Вы находитесь либо слишком близко от игрока, либо слишком далеко от игрока");
				}
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GREY, "Игрок не найден");
			return true;
		}
	}
	return true;
}

COMMAND:pee(playerid, params[])
{
	if(Controllable[playerid])
	{
		J_ApplyAnimation(playerid,"PAULNMAC","wank_out",4.1, 1, 1, 1, 0, 0, 1);
	}
	return true;
}

/*COMMAND:piss(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    if(!IsAtWater(playerid))
	    {
			if(Controllable[playerid])
			{
			    if(PlayerInfo[playerid][pSex] == 1)
			    {
			        if(GetPlayerSpecialAction(playerid) != 68)
			        {
			            if(!PlayerPiss[playerid])
			            {
				            if(PissNeed[playerid] >= 150)
				            {
						        new string[100];
								format(string,sizeof(string),"* %s расстегивает ширинку чтобы справить нужду",cPN(playerid));
								ProxDetector(15,playerid,string,COLOR_PURPLE);
								ApplyAnimation(playerid,"PAULNMAC","Piss_in",4.1, 0, 1, 1, 0, 0, 1);
								PissTimer[playerid] = SetPlayerTimer(playerid,"PlayerPissing",2000,false);
								PlayerPiss[playerid] = 1;
							}
							else SendClientMessage(playerid,COLOR_GREY,"Вы не хотите справлять нужду");
						}
						else SendClientMessage(playerid,COLOR_GREY,"Вы уже справляете нужду");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Вы уже справляете нужду");
				}
			}
		}
		else SendClientMessage(playerid,COLOR_GREY,"Нельзя справлять нужду в воде");
	}
	return true;
}*/

/*
public PlayerPissing(playerid)
{
	if(PlayerPiss[playerid] == 1)
	{
	    new string[50];
		SetPlayerSpecialAction(playerid,68);
		format(string,sizeof(string),"* %s справляет нужду",cPN(playerid));
		ProxDetector(15,playerid,string,COLOR_PURPLE);
		PissMessage[playerid] = false;
		PlayerPiss[playerid] = 2;
	}
	return true;
}*/

COMMAND:iznas(playerid, params[])
{
	new
		giveplayerid,
		string[200];
	if(!IsPlayerLogged[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Вы ещё не залогинились");
	if(sscanf(params,"u",giveplayerid))return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /iznas [id игрока]");
	if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "Вы не рядом с игроком");
	if(giveplayerid == playerid) return SendClientMessage(playerid,COLOR_GREY,"И как ты себе это представляеш? O_o");
	if(IznasTime[playerid] >= 1) return SendClientMessage(playerid,COLOR_GREY,"Ещё не прошла 1 минута с момента последнего изнасилования");
	if(PlayerInfo[playerid][pSex] == PlayerInfo[giveplayerid][pSex]) return SendClientMessage(playerid,COLOR_GREY,"Этот оппонент того же пола, что и вы");
	format(string,256,"Вы изнасиловали игрока %s",cPN(giveplayerid));
	SendClientMessage(playerid,COLOR_GREEN,string);
	format(string,256,"Вы били износилованы игроком %s",cPN(playerid));
	SendClientMessage(giveplayerid,COLOR_TOMATO,string);
	ApplyAnimation(giveplayerid,"SNM","SPANKINGW",4.1, 0, 1, 1, 0, 0, 1);
   	ApplyAnimation(playerid,"SNM","SPANKEDW",4.1, 0, 1, 1, 0, 0, 1);
	format(string,sizeof(string),"* %s изнасиловал игрока %s",cPN(playerid),cPN(giveplayerid));
	ProxDetector(15.0, playerid, string, COLOR_PURPLE);
	IznasTime[playerid] = 60;
	return true;
}

COMMAND:killme(playerid, params[])
{
	if(PlayerInfo[playerid][pPoison] > 0)
	{
	    PlayerInfo[playerid][pPoison] --;
		if(!Crack[playerid] && !IsPlayerInAnyVehicle(playerid))
		{
			new string[50];
		    format(string, sizeof(string), "* %s принял дозу яда", cPN(playerid));
		    ProxDetector(15.0, playerid, string, COLOR_PURPLE);
		    SetPlayerDrunkLevel(playerid, 50000);
			ApplyAnimation(playerid,"KNIFE","KILL_Knife_Ped_Damage",4.1, 0, 1, 1, 0, 0, 1);
			SetPlayerTimer(playerid,"DeathPlayer",1700,false);
		}
		else DeathPlayer(playerid);
	}
	else SendClientMessage(playerid,COLOR_GREY,"У вас нет яда");
	return true;
}

public DeathPlayer(playerid)
{
    SetPlayerDrunkLevel(playerid, 0);
    SetSpawnInfo(playerid, 255, PlayerInfo[playerid][pSkin], 1269.8123, -1223.0795, 999.1, 90.0, 0, 0, 0, 0, 0, 0);
	PlayerInfo[playerid][pHeal] = 1;
    return J_SetPlayerHealth(playerid,0);
}

COMMAND:smoke(playerid, params[])
{
	new
	    string[200];
	if(!PlayerInfo[playerid][pHeal])
	{
		if(PlayerInfo[playerid][pSigs] > 0)
		{
			if(PlayerInfo[playerid][pLighter] > 0)
			{
			    if(!Smoke[playerid])
			    {
				    new randsig = random(2);
				    if(!randsig)
				    {
				        format(string,sizeof(string),"* %s достал сигарету с зажигалкой и попытался закурить (Неудачно)",cPN(playerid));
				        ProxDetector(15.0,playerid,string,COLOR_PURPLE);
				    }
				    else
				    {
				        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
				        format(string,sizeof(string),"* %s достал сигарету с зажигалкой и закурил",cPN(playerid));
				        ProxDetector(15.0,playerid,string,COLOR_PURPLE);
				        PlayerInfo[playerid][pLighter] --;
				        PlayerInfo[playerid][pSigs] --;
				        Smoke[playerid] = 1;
						SmokeTime[playerid] = 10;
						Smokes[playerid] = 0;
				    }
			    }
		    }
		    else
		    {
		        SendClientMessage(playerid,COLOR_GREY,"У вас нет зажигалки");
		    }
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"У вас нет сигарет");
		}
	}
	else
	{
 		SendClientMessage(playerid,COLOR_GREY,"Пока вы находитесь на личении вам запрещено курить");
	}
	return true;
}

COMMAND:vopros(playerid, params[])
{
	return cmd_ask(playerid, params);
}

COMMAND:ask(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
	    if(PlayerInfo[playerid][pAskBan]) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете писать в /ask т.к вам дали бан на этот чат");
	    if(!VoprosReset[playerid])
	    {
	        new CountHelpers;
		    for(new i;i < GetMaxPlayersEx();i ++)
		    {
		        if(!IsPlayerConnected(i)) continue;
				if(PlayerInfo[i][pHelper] > 0)
				{
					if(HDuty[i])
					{
						CountHelpers ++;
					}
				}
			}
			new string[200];
	        format(string,sizeof(string),"Введите текст вашего вопроса\n\n{33CCFF}Хелперов на дежурстве: %d",CountHelpers);
			if(!ShowPlayerDialogEx(playerid,85,1,"Введите ваш вопрос",string,"Отправить","Отмена"))
			{
			    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
		}
	}
	return true;
}

COMMAND:re(playerid, params[])
{
	return cmd_report(playerid, params);
}

COMMAND:report(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
	    if(PlayerInfo[playerid][pRepBan] > 0) return SendClientMessage(playerid, COLOR_GREY, "Вы не можете писать в /report т.к вам дали бан на этот чат");
	    if(!ReportReset[playerid])
	    {
			AtMenu[playerid] = false;
		    ShowReportDialog(playerid);
		}
		else SendClientMessage(playerid, COLOR_GREY, "Писать админам можно только раз в 30 секунд");
	}
	return true;
}

COMMAND:sellgun(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_GUNDEALER)
	{
	    if(!IsANotControllable(playerid))
	    {
		    if(!SGunReset[playerid])
		    {
				new id,name[30],ammo,price,string[200];
				if(sscanf(params,"us[10]dd",id,name,ammo,price))
				{
					SendClientMessage(playerid,COLOR_GREEN,"Используйте: /sellgun [id] [Название] [Кол-во] [цена]");
					SendClientMessage(playerid,COLOR_GREEN,"Названия: eagle,shotgun,mp5,m4,ak47,rifle,sniper");
					return true;
				}
				if(ProxDetectorS(3,playerid,id))
				{
				    if(PlayerInfo[id][pPlayHours] >= 3)
				    {
					    if(price > 0 && ammo > 0)
						{
							if(price > 500) return SendClientMessage(playerid,COLOR_GREY,"За свои услуги вы можете брать не более $500");
							SGunOffer[id] = playerid;
							SGunPrice[id] = price;
							SGunAmmo[id] = ammo;
							if(GetString(name,"eagle"))
							{
								SGunMats[id] = ammo*EagleMats;
								SGunID[id] = 24;
							}
							else if(GetString(name,"shotgun"))
							{
								SGunMats[id] = ammo*ShotGunMats;
								SGunID[id] = 25;
							}
							else if(GetString(name,"mp5"))
							{
								SGunMats[id] = ammo*MP5Mats;
								SGunID[id] = 29;
							}
							else if(GetString(name,"m4"))
							{
								SGunMats[id] = ammo*M4Mats;
								SGunID[id] = 31;
							}
							else if(GetString(name,"ak47"))
							{
								SGunMats[id] = ammo*AK47Mats;
								SGunID[id] = 30;
							}
							else if(GetString(name,"rifle"))
							{
								SGunMats[id] = ammo*RifleMats;
								SGunID[id] = 33;
							}
							else if(GetString(name,"sniper"))
							{
								SGunMats[id] = ammo*SniperMats;
								SGunID[id] = 34;
							}
							if(PlayerInfo[playerid][pMats] >= SGunMats[id])
							{
								format(string,sizeof(string),"{FFFFFF}\
								Игрок %s предлагает вам купить у него оружие.\n\n\
								Оружие: \t%s\n\
								Боеприпасы: \t%d\n\
								Цена: \t$%d",
								PN(playerid),
								GunName(SGunID[id]),
								ammo,
								price);
								ShowPlayerDialogEx(id,24,0,"Вам предложили купить оружие",string,"Купить","Отмена");
							}
						}
					}
					else SendClientMessage(playerid, COLOR_GREY, "Этот игрок должен отыграть хотябы 3 часа");
				}
			}
			else
			{
				SendClientMessage(playerid,COLOR_GREY,"Вы можете продавать оружие только 1 раз в 30 секунд");
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"Вы не можете двигаться");
		}
	}
	return true;
}

COMMAND:t(playerid, params[])
{
    new param[12],string[200], num;
	sscanf(params, "s[12]d", param, num);
	if(GetString(param,"lock"))
  	{
	    for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
			    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
				    if(!TrunkInfo[c][tOpen])
				    {
				        if(!IsAOwnableCar(c) || IsPlayerHaveCar(playerid,c))
				        {
					        TrunkInfo[c][tOpen] = 1;
					        SendClientMessage(playerid,-1,"Багажник открыт");
			       			SetBootStatus(c,1);
		       			}
		       			else
		       			{
		       			    SendClientMessage(playerid,COLOR_GREY,"У вас нет ключей от этого транспорта");
		       			}
					}
					else
					{
					    TrunkInfo[c][tOpen] = 0;
				        SendClientMessage(playerid,-1,"Багажник закрыт");
		       			SetBootStatus(c,0);
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"info"))
 	{
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
			    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen] == 1)
					{
						new str[500] = "{FFFFFF}";
						for(new i;i < 10;i ++)
						{
						    if(TrunkInfo[c][tGun][i] != 0)
						    {
						        format(string,sizeof(string),"Оружие[%d]: %s | Патроны: %d\n",i+1,GunName(TrunkInfo[c][tGun][i]),TrunkInfo[c][tAmmo][i]);
						        strcat(str,string);
						    }
						}
						format(string,sizeof(string),"Деньги: $%d\n",TrunkInfo[c][tMoney]);
						strcat(str,string);
						format(string,sizeof(string),"Материалы: %d\n",TrunkInfo[c][tMats]);
						strcat(str,string);
						format(string,sizeof(string),"Наркотики: %dг\n",TrunkInfo[c][tDrugs]);
						strcat(str,string);
						format(string,sizeof(string),"Бронежилеты: %dшт\n",TrunkInfo[c][tArmours]);
						strcat(str,string);
						ShowPlayerDialogEx(playerid,INVALID_DIALOG_ID,0,"Багажник",str,"ОК","");
					}
					else
					{
							SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт.Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"putarmour"))
  	{
  	    if(PlayerInfo[playerid][pArmours])
  	    {
  	        for(new c = 1; c < ADD_VEHICLES; c ++)
			{
			    if(!IsACar(c)) continue;
			    new Float:X,Float:Y,Float:Z;
				GetVehicleShiftPos(c,1,X,Y,Z,3.0);
				if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
				{
				    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
				    if(angle >= -45 && angle <= 45)
				    {
					    if(TrunkInfo[c][tOpen] == 1)
						{
							if(TrunkInfo[c][tArmours] < 5)
							{
							    TrunkInfo[c][tArmours] ++;
							    PlayerInfo[playerid][pArmours] --;
							    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы положили бронежилет в багажник");
							}
							else SendClientMessage(playerid,COLOR_GREY,"В багажнике уже лежит 5 бронежилетов");
						}
						else SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
						break;
					}
				}
			}
  	    }
  	    else SendClientMessage(playerid,COLOR_GREY,"У вас нет бронежилета");
  	}
  	else if(GetString(param,"takearmour"))
  	{
  	    if(!PlayerInfo[playerid][pArmours])
  	    {
  	        for(new c = 1; c < ADD_VEHICLES; c ++)
			{
			    if(!IsACar(c)) continue;
			    new Float:X,Float:Y,Float:Z;
				GetVehicleShiftPos(c,1,X,Y,Z,3.0);
				if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
				{
				    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    	if(angle >= -45 && angle <= 45)
			    	{
					    if(TrunkInfo[c][tOpen] == 1)
						{
							if(TrunkInfo[c][tArmours] > 0)
							{
							    TrunkInfo[c][tArmours] --;
							    PlayerInfo[playerid][pArmours] ++;
							    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы достали бронежилет с багажника");
							}
							else SendClientMessage(playerid,COLOR_GREY,"В багажнике нет бронежилетов");
						}
						else SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
						break;
					}
				}
			}
  	    }
  	    else SendClientMessage(playerid,COLOR_GREY,"У вас уже есть бронежилет");
  	}
	else if(GetString(param,"putgun"))
  	{
  	    //if(ReturnOne()) return SendClientMessage(playerid, COLOR_GREY, "Эта функция была удалена 9.06.2012г");
	    if(GunUP[playerid]) return SendClientMessage(playerid,COLOR_GREY,"Нельзя положить в багажник оружие с набора");
	    if(GunReset[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, "Подождите 2-3 секунды");
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
			    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen] == 1)
					{
						if(GetPlayerWeapon(playerid) != 0)
						{
							new bool:succesput;
						    for(new i;i < 10;i ++)
						    {
								if(!TrunkInfo[c][tGun][i])
								{
								    AntiGunCheat(playerid);
									format(string,sizeof(string),"Вы положили в багажник %s с %d патронами",GunName(GetPlayerWeapon(playerid)),GetAmmo(playerid));
									SendClientMessage(playerid,-1,string);
									TrunkInfo[c][tGun][i] = GetPlayerWeapon(playerid);
									TrunkInfo[c][tAmmo][i] = GetAmmo(playerid);
									RemovePlayerWeapon(playerid,GetPlayerWeapon(playerid));
									SaveTrunk(c);
									succesput = true;
									GunReset[playerid] = 3;
									break;
								}
							}
							if(!succesput)
							{
								SendClientMessage(playerid,COLOR_GREY,"В багажнике нет свободного места");
							}
						}
						else
						{
							SendClientMessage(playerid,COLOR_GREY,"В ваших руках нет оружия");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
 	else if(GetString(param,"takegun"))
  	{
  	    if(GunReset[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, "Подождите 2-3 секунды");
  	    if(num < 1 || num > 10) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /t takegun [Номер слота (1-10)]");
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
				new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen])
					{
						new i = num-1;
						if(TrunkInfo[c][tGun][i] != 0)
						{
						    new weaponid = TrunkInfo[c][tGun][i];
						    new ammo = TrunkInfo[c][tAmmo][i];
						    new weapon = J_GivePlayerWeapon(playerid,weaponid,ammo);
						    if(weapon != -1)
						    {
								format(string,sizeof(string),"Вы достали с багажника %s с %d патронами",GunName(weaponid),ammo);
								SendClientMessage(playerid,-1,string);
								TrunkInfo[c][tGun][i] = 0;
								TrunkInfo[c][tAmmo][i] = 0;
								GunReset[playerid] = 3;
								SaveTrunk(c);
								if(weapon == 2)
								{
								    format(string,sizeof(string),"Нельзя носить с собой более {33AA33}%i {FFFFFF}боеприпасов для {33CCFF}%s",MaxAmmo[weaponid],GunName(weaponid));
									SendClientMessage(playerid,COLOR_WHITE,string);
								}
							}
							else
							{
							    SendClientMessage(playerid,COLOR_GREY,"Нельзя носить более 4-х едениц оружия");
							}
						}
						else
						{
							SendClientMessage(playerid,COLOR_GREY,"В этом слоте нет оружия");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"putmoney"))
  	{
  	    //if(ReturnOne()) return SendClientMessage(playerid, COLOR_GREY, "Эта функция была удалена 9.06.2012г");
  	    if(PlayerInfo[playerid][pExp] >= 5 || PlayerInfo[playerid][pLevel] > 1)
  	    {
			if(num > 0)
			{
				for(new c = 1; c < ADD_VEHICLES; c ++)
				{
				    if(!IsACar(c)) continue;
					new Float:X,Float:Y,Float:Z;
					GetVehicleShiftPos(c,1,X,Y,Z,3.0);
					if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
					{
					    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
					    if(angle >= -45 && angle <= 45)
					    {
							if(TrunkInfo[c][tOpen])
							{
								if(num <= GetMoney(playerid))
								{
									format(string,sizeof(string),"Вы положили в багажник $%d",num);
									SendClientMessage(playerid,COLOR_WHITE,string);
									TrunkInfo[c][tMoney] += num;
									GiveMoney(playerid,-num,"PutMoney (trunk)");
									SaveTrunk(c);
									SaveAccount(playerid);
								}
								else
								{
								    SendClientMessage(playerid,COLOR_GREY,"У вас нет столько денег");
								}
							}
							else
						    {
						        SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт.Откройте его (( /t lock ))");
						    }
						    break;
					    }
					}
				}
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Используйте: /t putmoney [$]");
			}
		}
	}
	else if(GetString(param,"takemoney"))
  	{
  	    if(num > 0)
		{
		    for(new c = 1; c < ADD_VEHICLES; c ++)
			{
			    if(!IsACar(c)) continue;
				new Float:X,Float:Y,Float:Z;
				GetVehicleShiftPos(c,1,X,Y,Z,3.0);
				if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
				{
				    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
				    if(angle >= -45 && angle <= 45)
				    {
					    if(TrunkInfo[c][tOpen] == 1)
					    {
							if(num <= TrunkInfo[c][tMoney])
							{
								format(string,sizeof(string),"Вы достали из багажника $%d",num);
								SendClientMessage(playerid,COLOR_WHITE,string);
								TrunkInfo[c][tMoney] -= num;
								GiveMoney(playerid,num,"TakeMoney (trunk)");
								SaveTrunk(c);
								SaveAccount(playerid);
							}
							else
							{
							    SendClientMessage(playerid,COLOR_GREY,"В багажнике нет столько денег");
							}
						}
						else
					    {
					        SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт.Откройте его (( /t lock ))");
					    }
					    break;
				    }
				}
			}
		}
		else
		{
		    SendClientMessage(playerid,COLOR_GREY,"Используйте: /t takemoney [$]");
		}
	}
	else if(GetString(param,"putdrugs"))
  	{
  	    if(num < 1) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /t putdrugs [Кол-во]");
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
				new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen])
					{
						if(num <= PlayerInfo[playerid][pDrugs])
						{
							format(string,sizeof(string),"Вы положили в багажник %dг наркотиков",num);
							SendClientMessage(playerid,COLOR_WHITE,string);
							TrunkInfo[c][tDrugs] += num;
							PlayerInfo[playerid][pDrugs] -= num;
							SaveTrunk(c);
						}
						else
						{
							SendClientMessage(playerid,COLOR_GREY,"У вас нет столько наркотиков");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"takedrugs"))
  	{
  	    if(num < 1) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /t takedrugs [Кол-во]");
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
				new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen])
					{
						if(num <= TrunkInfo[c][tDrugs])
						{
							format(string,sizeof(string),"Вы достали из багажника %dг наркотиков",num);
							SendClientMessage(playerid,COLOR_WHITE,string);
							TrunkInfo[c][tDrugs] -= num;
							PlayerInfo[playerid][pDrugs] += num;
							SaveTrunk(c);
						}
						else
						{
							SendClientMessage(playerid,COLOR_GREY,"В багажнике нет столько наркотиков");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"putmats"))
  	{
  	    if(num < 1) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /t putmats [Кол-во]");
		for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
				new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
					if(TrunkInfo[c][tOpen])
					{
						if(num <= PlayerInfo[playerid][pMats])
						{
							format(string,sizeof(string),"Вы положили в багажник %d материалов",num);
							SendClientMessage(playerid,COLOR_WHITE,string);
							TrunkInfo[c][tMats] += num;
							PlayerInfo[playerid][pMats] -= num;
							SaveTrunk(c);
						}
						else
						{
							SendClientMessage(playerid,COLOR_GREY,"У вас нет столько материалов");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else if(GetString(param,"takemats"))
  	{
  	    if(num < 1) return SendClientMessage(playerid, COLOR_GREY, "Используйте: /t takemats [Кол-во]");
  	    for(new c = 1; c < ADD_VEHICLES; c ++)
		{
		    if(!IsACar(c)) continue;
			new Float:X,Float:Y,Float:Z;
			GetVehicleShiftPos(c,1,X,Y,Z,3.0);
			if(IsPlayerInRangeOfPoint(playerid,1,X,Y,Z))
			{
			    new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
			    if(angle >= -45 && angle <= 45)
			    {
				    if(TrunkInfo[c][tOpen])
				    {
						if(num <= TrunkInfo[c][tMats])
						{
						    if(PlayerInfo[playerid][pMats] + num > 2000) return SendClientMessage(playerid, COLOR_GREY, "Вы не сможете унести с собой более 2000 материалов");
							format(string,sizeof(string),"Вы достали из багажника %d материалов",num);
							SendClientMessage(playerid,COLOR_WHITE,string);
							TrunkInfo[c][tMats] -= num;
							PlayerInfo[playerid][pMats] += num;
							SaveTrunk(c);
						}
						else
						{
						    SendClientMessage(playerid,COLOR_GREY,"В багажнике нет столько материалов");
						}
					}
					else
					{
						SendClientMessage(playerid,COLOR_GREY,"Багажник закрыт. Откройте его (( /t lock ))");
					}
					break;
				}
			}
		}
	}
	else ShowTrunkHelp(playerid, INVALID_DIALOG_ID);
	return true;
}

COMMAND:unmute(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new id,string[200];
	    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /unmute [id]");
	    if(IsPlayerConnected(id))
	    {
	        if(PlayerInfo[id][pMuteTime] > 0)
	        {
	            PlayerInfo[id][pMuteTime] = 0;
	            format(string,sizeof(string),"** Администратор %s разглушил вас",PN(playerid));
	            SendClientMessage(id,COLOR_LIGHTBLUE,string);
	            format(string,sizeof(string),"** Администратор %s разглушил игрока %s",PN(playerid),PN(id));
	            SendAdminsMessage(COLOR_YELLOW,string,1);
	        }
	    }
	}
	return true;
}

/*COMMAND:cvet(playerid, params[])
{
	if(!InMP[playerid] && !GetPlayerInterior(playerid))
	{
		ShowPlayerDialogEx(playerid,55,DIALOG_STYLE_LIST,"{FFB6C1}Меню цветов","\
		{000000}Черный\n\
		{FF0000}Красный\n\
		{BEBEBE}Серый\n\
		{006400}Зеленый\n\
		{EEA2AD}Розовый\n\
		{00FF00}Лайм\n\
		{0000FF}Синий\n\
		{FFFF00}Желтый\n\
		{00FFFF}Голубой\n\
		{FFA500}Оранжевый\n\
		{FF00FF}Магента\n\
		{FF6347}Томатный\n\
		{551A8B}Индиго\n\
		{B8860B}Золотой\n\
		{698B22}Оливковый\n\
		{9ACD32}Желто-Зеленый\n\
		{8B4513}Коричневый\n\
		{EE6A50}Коралловый\n\
		{FF4500}Красно-оранжевый\n\
		{AFAFAF}Стандартный\n\
		Отключить цвет\
		","Применить"," Отмена");
	}
	return true;
}*/

COMMAND:gotocar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
    	new id,Float:X,Float:Y,Float:Z;
		if(sscanf(params,"d",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используй: /gotocar [id]");
		if(id < ADD_VEHICLES)
		{
		    GetVehiclePos(id,X,Y,Z);
		    J_SetPlayerPos(playerid,X,Y,Z+2);
		    return true;
		}
	}
	return false;
}

COMMAND:getcar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
    	new id,Float:X,Float:Y,Float:Z;
		if(sscanf(params,"d",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используй: /getcar [id]");
		if(id < ADD_VEHICLES)
		{
		    GetPlayerPos(playerid,X,Y,Z);
		    J_SetVehiclePos(id,X,Y,Z);
		    J_SetPlayerPos(playerid,X,Y,Z+2);
		    return true;
		}
	}
	return false;
}

COMMAND:vehid(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new string[100];
	    new carid = GetPlayerVehicleID(playerid);
	    format(string,sizeof(string),"ID Этого транспорта: %d | Model: %d",carid, GetVehicleModelEx(carid));
	    SendClientMessage(playerid,COLOR_GREY,string);
	    if(VehicleInfo[carid][vTeam] > 0)
	    {
	    	format(string,sizeof(string),"Org: %d",VehicleInfo[carid][vTeam]);
	    	SendClientMessage(playerid,COLOR_GREY,string);
		}
		if(VehicleInfo[carid][vJob] > 0)
		{
		    format(string,sizeof(string),"Job: %d",VehicleInfo[carid][vJob]);
		    SendClientMessage(playerid,COLOR_GREY,string);
	    }
	    return true;
	}
	return false;
}

COMMAND:fightstyle(playerid, params[])
{
	if(!ShowPlayerDialogEx(playerid,58,2,"Выберите стиль боя","Обычный\nBoxing\nKungfu\nKeenhead\nElbow","Выбрать","Отмена"))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:fight(playerid, params[])
{
	if(PlayerInfo[playerid][pJob] == JOB_COACH)
	{
		new id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используй: /fight [id]");
		if(ProxDetectorS(5.0,playerid,id))
		{
		    if(!ShowPlayerDialogEx(playerid,57,2,"Выберите пункт","Обучить Kungfu\nОбучить Kneehead\nОбучить Elbow\nОбучить Boxing\nОбучить всем стилям","Выбрать","Отмена"))
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		    }
		    else
		    {
		        Fight[playerid] = id;
		    }
		}
	}
	return true;
}

COMMAND:restart(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    return ServerRestart(1);
	}
	return false;
}

COMMAND:gmx(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    return ServerRestart(0);
	}
	return false;
}

COMMAND:stavka(playerid, params[])
{
    if(PlayerInfo[playerid][pPlayHours] < 5) return SendClientMessage(playerid, 0xFF0000FF, "Делать ставки можно будет после 5-и часов в игре!");
	for(new i; i < sizeof(RingInfo); i ++)
	{
		if(GetPlayerVirtualWorld(playerid) == RingInfo[i][rgWorld])
		{
			if(IsPlayerInRangeOfPoint(playerid, 30.0, RingInfo[i][rgPos1][0], RingInfo[i][rgPos1][1], RingInfo[i][rgPos1][2]))
			{
				if(RingInfo[i][rgState] == 1)
				{
					new string[60];
					format(string, sizeof(string), "1. {33CCFF}%s\n2. {10F441}%s", PN(RingInfo[i][rgPlayer][0]), PN(RingInfo[i][rgPlayer][1]));
					ShowPlayerDialog(playerid, 270, 2, "Выберите бойца", string, "Выбор", "Отмена");
				}
			}
		}
	}
	return true;
}

COMMAND:sendup(playerid, params[])
{
	new string[70];
	if(BuyGuns[playerid] != -1)
	{
	    if(BuyGunAmmo[playerid] == 4) return true;
	    else if(BuyGunAmmo[playerid] == 3) TextDrawHideForPlayer(playerid, ButtonUp);
		BuyGunAmmo[playerid] ++;
	    new bgid = BuyGuns[playerid];
	    new ammo = BuyGunAmmo[playerid];
	    new gunid = BuyGunInfo[bgid][bgGunid];
	    if(!BuyGunInfo[bgid][bgAmmo][ammo])
	    {
	        BuyGunAmmo[playerid] --;
	        ammo = BuyGunAmmo[playerid];
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    }
	    else TextDrawShowForPlayer(playerid, ButtonDown);
	    new Float:flprice = float(BuyGunInfo[bgid][bgPrice]);
	    new Float:flammo = float(BuyGunInfo[bgid][bgAmmo][0]);

	    new price = floatround( (flprice / flammo) * float(BuyGunInfo[bgid][bgAmmo][ammo]) );
		if(!gexist(playerid, gunid)) price += BuyGunInfo[bgid][bgGPrice];
        format(string, sizeof(string), "~w~Name: %s~n~Ammo: %d~n~Cost: $%d", WeaponNames[gunid], BuyGunInfo[bgid][bgAmmo][ammo], price);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyingCar[playerid] != -1)
	{
		new leader = PlayerInfo[playerid][pLeader];
	    TextDrawShowForPlayer(playerid, ButtonDown);
	    BuyingModel[playerid] ++;
	    new nummodel = BuyingModel[playerid];
	    new buy = BuyingCar[playerid];
	    new oldmodel = GetVehicleModel(TeamCar[leader][buy]);
	    if(nummodel < 6 && BuyTCModels[leader][nummodel] != 0)
	    {
	        new Float:X, Float:Y, Float:Z, Float:A, model;
			X = BuyTeamCars[leader][bcPos_X][ buy ];
			Y = BuyTeamCars[leader][bcPos_Y][ buy ];
			Z = BuyTeamCars[leader][bcPos_Z][ buy ];
			A = BuyTeamCars[leader][bcPos_A][ buy ];
			DestroyVehicleEx(PlayerBuyTC[playerid]);
			model = BuyTCModels[leader][nummodel];
			PlayerBuyTC[playerid] = CreateVehicle(model, X, Y, Z, A, TeamCarColor[leader][0], TeamCarColor[leader][1], 1000);
            SetVehicleVirtualWorld(PlayerBuyTC[playerid], GetPlayerVirtualWorld(playerid));
			format(string,sizeof(string),"~w~Current: ~r~%s~n~~w~Model: ~g~%s~n~~w~Cost: ~g~$%d",
			GetVehicleName(oldmodel), GetVehicleName(model), GetTeamCarCost(model));
			PlayerTextDrawSetString(playerid, InfoText[playerid], string);
			if(nummodel == 5) TextDrawHideForPlayer(playerid, ButtonUp);
	    }
	    else
	    {
	        TextDrawHideForPlayer(playerid, ButtonUp);
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	        BuyingModel[playerid] --;
	    }
	}
	else PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	return true;
}

COMMAND:senddown(playerid, params[])
{
    new string[70];
	if(BuyGuns[playerid] != -1)
	{
	    if(BuyGunAmmo[playerid] == 0) return true;
	    else if(BuyGunAmmo[playerid] == 1) TextDrawHideForPlayer(playerid, ButtonDown);
	    BuyGunAmmo[playerid] --;
	    new bgid = BuyGuns[playerid];
	    new ammo = BuyGunAmmo[playerid];
	    new gunid = BuyGunInfo[bgid][bgGunid];
	    if(!BuyGunInfo[bgid][bgAmmo][ammo])
	    {
	        BuyGunAmmo[playerid] ++;
	        ammo = BuyGunAmmo[playerid];
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    }
	    else TextDrawShowForPlayer(playerid, ButtonUp);
	    new Float:flprice = float(BuyGunInfo[bgid][bgPrice]);
	    new Float:flammo = float(BuyGunInfo[bgid][bgAmmo][0]);

	    new price = floatround( (flprice / flammo) * float(BuyGunInfo[bgid][bgAmmo][ammo]) );
		if(!gexist(playerid, gunid)) price += BuyGunInfo[bgid][bgGPrice];
        format(string, sizeof(string), "~w~Name: %s~n~Ammo: %d~n~Cost: $%d", WeaponNames[gunid], BuyGunInfo[bgid][bgAmmo][ammo], price);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyingCar[playerid] != -1)
	{
		new leader = PlayerInfo[playerid][pLeader];
	    TextDrawShowForPlayer(playerid, ButtonUp);
	    BuyingModel[playerid] --;
	    new nummodel = BuyingModel[playerid];
	    new buy = BuyingCar[playerid];
	    new oldmodel = GetVehicleModel(TeamCar[leader][buy]);
	    if(nummodel >= 0 && BuyTCModels[leader][nummodel] != 0)
	    {
	        new Float:X, Float:Y, Float:Z, Float:A, model;
			X = BuyTeamCars[leader][bcPos_X][ buy ];
			Y = BuyTeamCars[leader][bcPos_Y][ buy ];
			Z = BuyTeamCars[leader][bcPos_Z][ buy ];
			A = BuyTeamCars[leader][bcPos_A][ buy ];
			DestroyVehicleEx(PlayerBuyTC[playerid]);
			model = BuyTCModels[leader][nummodel];
			PlayerBuyTC[playerid] = CreateVehicle(model, X, Y, Z, A, TeamCarColor[leader][0], TeamCarColor[leader][1], 1000);
            SetVehicleVirtualWorld(PlayerBuyTC[playerid], GetPlayerVirtualWorld(playerid));
			format(string,sizeof(string),"~w~Current: ~r~%s~n~~w~Model: ~g~%s~n~~w~Cost: ~g~$%d",
			GetVehicleName(oldmodel), GetVehicleName(model), GetTeamCarCost(model));
			PlayerTextDrawSetString(playerid, InfoText[playerid], string);
			if(nummodel == 0) TextDrawHideForPlayer(playerid, ButtonDown);
	    }
	    else
	    {
	        TextDrawHideForPlayer(playerid, ButtonDown);
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	        BuyingModel[playerid] ++;
	    }
	}
	else PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	return true;
}

COMMAND:next(playerid, params[])
{
    new string[100];
    if(CreateHouse[playerid][chInt] != -1)
	{
	    if(CreateHouse[playerid][chInt] == (sizeof(IntInfo)-1)) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(CreateHouse[playerid][chInt] == (sizeof(IntInfo)-2)) TextDrawHideForPlayer(playerid, ButtonRight);
		TextDrawShowForPlayer(playerid, ButtonLeft);
	    CreateHouse[playerid][chInt] ++;
		new int = CreateHouse[playerid][chInt];
		SetPlayerInterior(playerid,IntInfo[int][iInterior]);
		SetPlayerCameraPos(playerid,IntInfo[int][iCam_X],IntInfo[int][iCam_Y],IntInfo[int][iCam_Z]); //
		SetPlayerCameraLookAt(playerid,IntInfo[int][iCamAt_X],IntInfo[int][iCamAt_Y],IntInfo[int][iCamAt_Z]); //
		format(string,sizeof(string),"Level: %d~n~Cost: $%d",IntInfo[int][iLevel],IntInfo[int][iCost]);
		PlayerTextDrawSetString(playerid, InfoText[playerid],string);
	}
    else if(BuyInt[playerid] != -1)
	{
	    if(BuyInt[playerid] == (sizeof(IntInfo)-1)) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(BuyInt[playerid] == (sizeof(IntInfo)-2)) TextDrawHideForPlayer(playerid, ButtonRight);
		TextDrawShowForPlayer(playerid, ButtonLeft);
	    BuyInt[playerid] ++;
		new int = BuyInt[playerid];
		SetPlayerInterior(playerid,IntInfo[int][iInterior]);
		SetPlayerCameraPos(playerid,IntInfo[int][iCam_X],IntInfo[int][iCam_Y],IntInfo[int][iCam_Z]); //
		SetPlayerCameraLookAt(playerid,IntInfo[int][iCamAt_X],IntInfo[int][iCamAt_Y],IntInfo[int][iCamAt_Z]); //
		format(string,sizeof(string),"Level: %d~n~Cost: $%d",IntInfo[int][iLevel],IntInfo[int][iCost]);
		PlayerTextDrawSetString(playerid, InfoText[playerid],string);
	}
	else if(Clother[playerid] != -1)
	{
	    new nskin = PlayerInfo[playerid][pSkin];
		if(IsPlayerInRangeOfPoint(playerid,2.0,199.1063, -128.3574, 1003.5152) || !nskin)
		{
		    new race = PlayerInfo[playerid][pRace];
		    new clother = Clother[playerid];
			if(PlayerInfo[playerid][pSex] < 2)
			{
				if( (clother + 1) == sizeof(MSkins[]) ) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
				else if( (clother + 2) == sizeof(MSkins[]) ) TextDrawHideForPlayer(playerid, ButtonRight);
				else if(!MSkins[race][clother + 1]) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
				else if(!MSkins[race][clother + 2]) TextDrawHideForPlayer(playerid, ButtonRight);
				TextDrawShowForPlayer(playerid, ButtonLeft);
				Clother[playerid] ++;
				clother = Clother[playerid];
				if(MSkins[race][clother] != 0)
				{
					SetPlayerSkin(playerid,MSkins[race][clother]);
					format(string,sizeof(string),"~g~Cost: ~r~$%d",MSkinCost[clother]);
				}
			}
			else
			{
			    if( (clother + 1) == sizeof(GSkins[]) ) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
				else if( (clother + 2) == sizeof(GSkins[]) ) TextDrawHideForPlayer(playerid, ButtonRight);
				TextDrawShowForPlayer(playerid, ButtonLeft);
				Clother[playerid] ++;
				clother = Clother[playerid];
				SetPlayerSkin(playerid,GSkins[race][clother]);
				format(string,sizeof(string),"~g~Cost: ~r~$%d",GSkinCost[clother]);
			}
			if(nskin != 0)
			{
  	 			PlayerTextDrawSetString(playerid, InfoText[playerid],string);
				PlayerTextDrawShow(playerid,InfoText[playerid]);
			}
			else
			{
			    PlayerTextDrawHide(playerid,InfoText[playerid]);
			}
		}
	}
	else if(SpecCamID[playerid] != -1)
	{
	    if(SpecCamID[playerid] == (sizeof(CamInfo)-1)) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(SpecCamID[playerid] == (sizeof(CamInfo)-2)) TextDrawHideForPlayer(playerid, ButtonRight);
		TextDrawShowForPlayer(playerid, ButtonLeft);
	    SpecCamID[playerid] ++;
	    new cam = SpecCamID[playerid];
	    SetPlayerInterior(playerid,CamInfo[cam][cmInt]);
		SetPlayerCameraPos(playerid,CamInfo[cam][cmPos_X],CamInfo[cam][cmPos_Y],CamInfo[cam][cmPos_Z]);
		SetPlayerCameraLookAt(playerid,CamInfo[cam][cmLook_X],CamInfo[cam][cmLook_Y],CamInfo[cam][cmLook_Z]);
	}
	else if(SelectMobile[playerid] != -1)
	{
		if(SelectMobile[playerid] == 6) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
		else if(SelectMobile[playerid] == 5) TextDrawHideForPlayer(playerid, ButtonRight);
		TextDrawShowForPlayer(playerid, ButtonLeft);
	    SelectMobile[playerid] ++;
	    new select = SelectMobile[playerid];
	    DestroyPlayerObject(playerid, SelectMobileObj[playerid]);
	    SelectMobileObj[playerid] = CreatePlayerObject(playerid, PhoneObject(select), MOBILE_CORDS);
	    format(string, sizeof(string), "Model: %s~w~Cost: $%d", GetPhoneName(select), MobilePrice[select]);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyGuns[playerid] != -1)
	{
	    if(BuyGuns[playerid] == MAX_GUNS) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(BuyGuns[playerid] == MAX_GUNS-1) TextDrawHideForPlayer(playerid, ButtonRight);
	    TextDrawShowForPlayer(playerid, ButtonLeft);
		BuyGuns[playerid] ++;
		BuyGunAmmo[playerid] = 0;
	    new bgid = BuyGuns[playerid];
		new gunid = BuyGunInfo[bgid][bgGunid];
	    new model = GetWeaponModel(gunid);
	    new price = BuyGunInfo[bgid][bgPrice];
		if(!gexist(playerid, gunid)) price += BuyGunInfo[bgid][bgGPrice];
     	if(BuyGunInfo[bgid][bgAmmo][1] != 0)
	    {
	        TextDrawShowForPlayer(playerid, ButtonUp);
	    }
	    else TextDrawHideForPlayer(playerid, ButtonUp);
		DestroyPlayerObject(playerid, TempBGObject[playerid]);
		TextDrawHideForPlayer(playerid, ButtonDown);
	    if(IsAFireGun(BuyGunInfo[bgid][bgGunid]))
		{
	   	 	TempBGObject[playerid] = CreatePlayerObject(playerid, model, GUN_POS, FIRE_GUN_ROT);
	    }
	    else
	    {
	        TempBGObject[playerid] = CreatePlayerObject(playerid, model, GUN_POS, GUN_ROT);
	    }
        format(string, sizeof(string), "~w~Name: %s~n~Ammo: %d~n~Cost: $%d", WeaponNames[gunid], BuyGunInfo[bgid][bgAmmo][0], price);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyingCar[playerid] != -1)
	{
		new leader = PlayerInfo[playerid][pLeader];
	    TextDrawShowForPlayer(playerid, ButtonLeft);
	    TextDrawShowForPlayer(playerid, ButtonUp);
	    TextDrawHideForPlayer(playerid, ButtonDown);
	    BuyingCar[playerid] ++;
	    BuyingModel[playerid] = 0;
	    new buy = BuyingCar[playerid];
	    new oldmodel = GetVehicleModel(TeamCar[leader][buy]);
	    if(buy < BuyTeamCars[leader][bcBuyCars])
	    {
	        new Float:X[2], Float:Y[2], Float:Z[2], Float:A, model;
	        new Float:cX, Float:cY, Float:cZ;
	        GetPlayerCameraPos(playerid, cX, cY, cZ);
			X[0] = BuyTeamCars[leader][bcPos_X][buy-1];
			Y[0] = BuyTeamCars[leader][bcPos_Y][buy-1];
			Z[0] = BuyTeamCars[leader][bcPos_Z][buy-1];
			X[1] = BuyTeamCars[leader][bcPos_X][ buy ];
			Y[1] = BuyTeamCars[leader][bcPos_Y][ buy ];
			Z[1] = BuyTeamCars[leader][bcPos_Z][ buy ];
			A 	 = BuyTeamCars[leader][bcPos_A][ buy ];
			DestroyVehicleEx(PlayerBuyTC[playerid]);
			model = BuyTCModels[leader][0];
			PlayerBuyTC[playerid] = CreateVehicle(model, X[1], Y[1], Z[1], A, TeamCarColor[leader][0], TeamCarColor[leader][1], 1000);
			InterpolateCameraLookAt(playerid, X[0], Y[0], Z[0], X[1], Y[1], Z[1], 1000, CAMERA_MOVE);
			ShiftCords(0, X[1], Y[1], Z[1], A, 6.0), Z[1] += 5.0;
			InterpolateCameraPos(playerid, cX, cY, cZ, X[1], Y[1], Z[1], 1000);
            SetVehicleVirtualWorld(PlayerBuyTC[playerid], GetPlayerVirtualWorld(playerid));
			format(string,sizeof(string),"~w~Current: ~r~%s~n~~w~Model: ~g~%s~n~~w~Cost: ~g~$%d",
			GetVehicleName(oldmodel), GetVehicleName(model), GetTeamCarCost(model));
			PlayerTextDrawSetString(playerid, InfoText[playerid], string);
			if(BuyTeamCars[leader][bcBuyCars] - buy == 1)
			{
				TextDrawHideForPlayer(playerid, ButtonRight);
			}
	    }
	    else
	    {
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	        TextDrawHideForPlayer(playerid, ButtonRight);
	        BuyingCar[playerid] --;
	    }
	}
	return true;
}

COMMAND:back(playerid, params[])
{
    new string[100];
    if(CreateHouse[playerid][chInt] != -1)
	{
	    if(CreateHouse[playerid][chInt] == 1) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(CreateHouse[playerid][chInt] == 2) TextDrawHideForPlayer(playerid, ButtonLeft);
		TextDrawShowForPlayer(playerid, ButtonRight);
	    CreateHouse[playerid][chInt] --;
		new int = CreateHouse[playerid][chInt];
		SetPlayerInterior(playerid,IntInfo[int][iInterior]);
		SetPlayerCameraPos(playerid,IntInfo[int][iCam_X],IntInfo[int][iCam_Y],IntInfo[int][iCam_Z]); //
		SetPlayerCameraLookAt(playerid,IntInfo[int][iCamAt_X],IntInfo[int][iCamAt_Y],IntInfo[int][iCamAt_Z]); //
		format(string,sizeof(string),"Level: %d~n~Cost: $%d",IntInfo[int][iLevel],IntInfo[int][iCost]);
		PlayerTextDrawSetString(playerid, InfoText[playerid],string);
	}
    else if(BuyInt[playerid] != -1)
	{
	    if(BuyInt[playerid] == 1) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(BuyInt[playerid] == 2) TextDrawHideForPlayer(playerid, ButtonLeft);
		TextDrawShowForPlayer(playerid, ButtonRight);
	    BuyInt[playerid] --;
		new int = BuyInt[playerid];
		SetPlayerInterior(playerid,IntInfo[int][iInterior]);
		SetPlayerCameraPos(playerid,IntInfo[int][iCam_X],IntInfo[int][iCam_Y],IntInfo[int][iCam_Z]); //
		SetPlayerCameraLookAt(playerid,IntInfo[int][iCamAt_X],IntInfo[int][iCamAt_Y],IntInfo[int][iCamAt_Z]); //
		format(string,sizeof(string),"Level: %d~n~Cost: $%d",IntInfo[int][iLevel],IntInfo[int][iCost]);
		PlayerTextDrawSetString(playerid, InfoText[playerid],string);
	}
	else if(Clother[playerid] != -1)
	{
	    new nskin = PlayerInfo[playerid][pSkin];
		if(IsPlayerInRangeOfPoint(playerid,2.0,199.1063, -128.3574, 1003.5152) || !nskin)
		{
	        new race = PlayerInfo[playerid][pRace];
	        if(Clother[playerid] == 0 ) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	        else if(Clother[playerid] == 1 ) TextDrawHideForPlayer(playerid, ButtonLeft);
			TextDrawShowForPlayer(playerid, ButtonRight);
			Clother[playerid] --;
			if(PlayerInfo[playerid][pSex] < 2)
			{
				SetPlayerSkin(playerid,MSkins[race][Clother[playerid]]);
				format(string,sizeof(string),"Cost: $%d",MSkinCost[Clother[playerid]]);
			}
			else
			{
				SetPlayerSkin(playerid,GSkins[race][Clother[playerid]]);
				format(string,sizeof(string),"Cost: $%d",GSkinCost[Clother[playerid]]);
			}
  	 		if(nskin != 0)
			{
  	 			PlayerTextDrawSetString(playerid, InfoText[playerid],string);
				PlayerTextDrawShow(playerid,InfoText[playerid]);
			}
			else
			{
			    PlayerTextDrawHide(playerid,InfoText[playerid]);
			}
		}
	}
	else if(SpecCamID[playerid] != -1)
	{
	    if(SpecCamID[playerid] == 0) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(SpecCamID[playerid] == 1) TextDrawHideForPlayer(playerid, ButtonLeft);
		TextDrawShowForPlayer(playerid, ButtonRight);
	    SpecCamID[playerid] --;
	    new cam = SpecCamID[playerid];
	    SetPlayerInterior(playerid,CamInfo[cam][cmInt]);
		SetPlayerCameraPos(playerid,CamInfo[cam][cmPos_X],CamInfo[cam][cmPos_Y],CamInfo[cam][cmPos_Z]);
		SetPlayerCameraLookAt(playerid,CamInfo[cam][cmLook_X],CamInfo[cam][cmLook_Y],CamInfo[cam][cmLook_Z]);
	}
	else if(SelectMobile[playerid] != -1)
	{
		if(SelectMobile[playerid] == 0) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
		else if(SelectMobile[playerid] == 1) TextDrawHideForPlayer(playerid, ButtonLeft);
		TextDrawShowForPlayer(playerid, ButtonRight);
	    SelectMobile[playerid] --;
	    new select = SelectMobile[playerid];
	    DestroyPlayerObject(playerid, SelectMobileObj[playerid]);
	    SelectMobileObj[playerid] = CreatePlayerObject(playerid, PhoneObject(select), MOBILE_CORDS);
	    format(string, sizeof(string), "Model: %s~w~Cost: $%d", GetPhoneName(select), MobilePrice[select]);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyGuns[playerid] != -1)
	{
	    if(BuyGuns[playerid] == 0) return PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    else if(BuyGuns[playerid] == 1) TextDrawHideForPlayer(playerid, ButtonLeft);
		TextDrawShowForPlayer(playerid, ButtonRight);
		DestroyPlayerObject(playerid, TempBGObject[playerid]);
		TextDrawHideForPlayer(playerid, ButtonDown);
		BuyGuns[playerid] --;
	    BuyGunAmmo[playerid] = 0;
	    new bgid = BuyGuns[playerid];
		new gunid = BuyGunInfo[bgid][bgGunid];
	    new model = GetWeaponModel(gunid);
	    new price = BuyGunInfo[bgid][bgPrice];
		if(!gexist(playerid, gunid)) price += BuyGunInfo[bgid][bgGPrice];
		if(BuyGunInfo[bgid][bgAmmo][1] != 0)
	    {
	        TextDrawShowForPlayer(playerid, ButtonUp);
	    }
	    else TextDrawHideForPlayer(playerid, ButtonUp);
	    if(IsAFireGun(BuyGunInfo[bgid][bgGunid]))
		{
	   	 	TempBGObject[playerid] = CreatePlayerObject(playerid, model, GUN_POS, FIRE_GUN_ROT);
	    }
	    else
	    {
	        TempBGObject[playerid] = CreatePlayerObject(playerid, model, GUN_POS, GUN_ROT);
	    }
        format(string, sizeof(string), "~w~Name: %s~n~Ammo: %d~n~Cost: $%d", WeaponNames[gunid], BuyGunInfo[bgid][bgAmmo][0], price);
		PlayerTextDrawSetString(playerid, InfoText[playerid], string);
	}
	else if(BuyingCar[playerid] != -1)
	{
		new leader = PlayerInfo[playerid][pLeader];
	    TextDrawShowForPlayer(playerid, ButtonLeft);
	    TextDrawShowForPlayer(playerid, ButtonUp);
	    TextDrawHideForPlayer(playerid, ButtonDown);
	    BuyingCar[playerid] --;
	    BuyingModel[playerid] = 0;
	    new buy = BuyingCar[playerid];
	    new oldmodel = GetVehicleModel(TeamCar[leader][buy]);
	    if(buy >= 0 && BuyTeamCars[leader][bcPos_X][buy] != 0)
	    {
	        new Float:X[2], Float:Y[2], Float:Z[2], Float:A, model;
	        new Float:cX, Float:cY, Float:cZ;
	        GetPlayerCameraPos(playerid, cX, cY, cZ);
			X[0] = BuyTeamCars[leader][bcPos_X][buy+1];
			Y[0] = BuyTeamCars[leader][bcPos_Y][buy+1];
			Z[0] = BuyTeamCars[leader][bcPos_Z][buy+1];
			X[1] = BuyTeamCars[leader][bcPos_X][ buy ];
			Y[1] = BuyTeamCars[leader][bcPos_Y][ buy ];
			Z[1] = BuyTeamCars[leader][bcPos_Z][ buy ];
			A 	 = BuyTeamCars[leader][bcPos_A][ buy ];
			DestroyVehicleEx(PlayerBuyTC[playerid]);
			model = BuyTCModels[leader][0];
			PlayerBuyTC[playerid] = CreateVehicle(model, X[1], Y[1], Z[1], A, TeamCarColor[leader][0], TeamCarColor[leader][1], 1000);
			InterpolateCameraLookAt(playerid, X[0], Y[0], Z[0], X[1], Y[1], Z[1], 1000, CAMERA_MOVE);
			ShiftCords(0, X[1], Y[1], Z[1], A, 6.0), Z[1] += 5.0;
			InterpolateCameraPos(playerid, cX, cY, cZ, X[1], Y[1], Z[1], 1000);
            SetVehicleVirtualWorld(PlayerBuyTC[playerid], GetPlayerVirtualWorld(playerid));
			format(string,sizeof(string),"~w~Current: ~r~%s~n~~w~Model: ~g~%s~n~~w~Cost: ~g~$%d",
			GetVehicleName(oldmodel), GetVehicleName(model), GetTeamCarCost(model));
			PlayerTextDrawSetString(playerid, InfoText[playerid], string);
			if(buy == 0) TextDrawHideForPlayer(playerid, ButtonLeft);
	    }
	    else
	    {
	        PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	        TextDrawHideForPlayer(playerid, ButtonLeft);
	        BuyingCar[playerid] ++;
	    }
	}
	return true;
}

COMMAND:done(playerid, params[])
{
	if(CreateHouse[playerid][chInt] != -1)
	{
	    new string[300];
	    new int = CreateHouse[playerid][chInt];
	    new i = GetIntGHS(int);
	    new houses = OWNABLEHOUSES;
	    OWNABLEHOUSES ++;

	    CreateHouse[playerid][chInt] = IntInfo[int][iInterior];
	    CreateHouse[playerid][chCost] = IntInfo[int][iCost];
	    CreateHouse[playerid][chLevel] = IntInfo[int][iLevel];
	    CreateHouse[playerid][chExit_X] = GHSPos[i][0];
	    CreateHouse[playerid][chExit_Y] = GHSPos[i][1];
	    CreateHouse[playerid][chExit_Z] = GHSPos[i][2];

	    HouseInfo[houses][hExit_X] = CreateHouse[playerid][chExit_X];
	    HouseInfo[houses][hExit_Y] = CreateHouse[playerid][chExit_Y];
	    HouseInfo[houses][hExit_Z] = CreateHouse[playerid][chExit_Z];
	    HouseInfo[houses][hEnter_X] = CreateHouse[playerid][chEnter_X];
	    HouseInfo[houses][hEnter_Y] = CreateHouse[playerid][chEnter_Y];
	    HouseInfo[houses][hEnter_Z] = CreateHouse[playerid][chEnter_Z];
	    HouseInfo[houses][hInt] = CreateHouse[playerid][chInt];
	    HouseInfo[houses][hCost] = CreateHouse[playerid][chCost];
	    HouseInfo[houses][hLevel] = CreateHouse[playerid][chLevel];

	    HouseIcon[houses] = CreateDynamicMapIcon(HouseInfo[houses][hEnter_X], HouseInfo[houses][hEnter_Y], HouseInfo[houses][hEnter_Z], 31, 0);
	    HouseCP[houses] = CreateDynamicCP(HouseInfo[houses][hEnter_X], HouseInfo[houses][hEnter_Y], HouseInfo[houses][hEnter_Z], 1.0, -1, -1, -1, 10.0);
       	House3DText[houses] = CreateDynamic3DTextLabel("*** Дом ***",0xE1AE3CFF,HouseInfo[houses][hEnter_X], HouseInfo[houses][hEnter_Y],HouseInfo[houses][hEnter_Z],20.0);
	    UpdateHouse(houses, false);

	    format(string, sizeof(string), "INSERT INTO `Houses` (`Enter_X`, `Enter_Y`, `Enter_Z`, `Exit_X`, `Exit_Y`, `Exit_Z`, `Level`, `Interior`, `Cost`) VALUE ('%.4f', '%.4f', '%.4f', '%.4f', '%.4f', '%.4f', '%d', '%d', '%d')",
	    CreateHouse[playerid][chEnter_X],
		CreateHouse[playerid][chEnter_Y],
		CreateHouse[playerid][chEnter_Z],
		CreateHouse[playerid][chExit_X],
		CreateHouse[playerid][chExit_Y],
		CreateHouse[playerid][chExit_Z],
		CreateHouse[playerid][chLevel],
		CreateHouse[playerid][chInt],
		CreateHouse[playerid][chCost]);
		mysql_query(string);

		format(string, sizeof(string), "\
		{FFFFFF}Позиция входа: {AFAFAF}%.4f, %.4f, %.4f\n\
		{FFFFFF}Позиция выхода: {AFAFAF}%.4f, %.4f, %.4f\n\
		{FFFFFF}Уровень: {AFAFAF}%d\n\
		{FFFFFF}Интерьер: {AFAFAF}%d\n\
		{FFFFFF}Стоимость: {AFAFAF}%d",
		CreateHouse[playerid][chEnter_X],
		CreateHouse[playerid][chEnter_Y],
		CreateHouse[playerid][chEnter_Z],
		CreateHouse[playerid][chExit_X],
		CreateHouse[playerid][chExit_Y],
		CreateHouse[playerid][chExit_Z],
		CreateHouse[playerid][chLevel],
		CreateHouse[playerid][chInt],
		CreateHouse[playerid][chCost]);
		ShowPlayerDialogEx(playerid, INVALID_DIALOG_ID, 0, "Вы успешно создали дом", string, "Ок", "");
		PlayerPlaySound(playerid, 30800, 0.0, 0.0, 0.0);
		J_TogglePlayerSpectating(playerid, false);
		PlayerTextDrawHide(playerid,InfoText[playerid]);
		SetTimerEx("ChangePlayerPos", 1000, false, "ifff", playerid, CreateHouse[playerid][chEnter_X], CreateHouse[playerid][chEnter_Y], CreateHouse[playerid][chEnter_Z]);
        CreateHouse[playerid][chInt] = -1;
	}
    else if(BuyInt[playerid] != -1)
 	{
 	    if(PlayerInfo[playerid][pHouseKey] != -1)
 	    {
		    new int = BuyInt[playerid];
		    if(PlayerInfo[playerid][pLevel] >= IntInfo[int][iLevel])
		    {
				if(GetMoney(playerid) >= IntInfo[int][iCost])
			    {
			        new string[12];
			        SettingSpawn(playerid);
			        J_TogglePlayerControllable(playerid, true);
					SendClientMessage(playerid,-1,"Поздравляю вас с покупкой нового интерьера!");
					format(string, sizeof(string), "BuyInt %i", int);
					GiveMoney(playerid,-IntInfo[int][iCost],string);
					SetHouseInt( PlayerInfo[playerid][pHouseKey], int );
					BuyInt[playerid] = -1;
					J_TogglePlayerSpectating(playerid, false);
					PlayerTextDrawHide(playerid,InfoText[playerid]);
					SaveHouse(PlayerInfo[playerid][pHouseKey]);
					PlayerPlaySound(playerid, 30800, 0.0, 0.0, 0.0);
					new house = PlayerInfo[playerid][pHouseKey];
					if(HouseInfo[house][hCabinet])
			       	{
			       	    new h = GetHouseStyle(house);
			       	    DestroyDynamicObject(HouseCabinet[house]);
			       	    if(h != -1)
			       	    {
			       	    	HouseCabinet[house] = CreateDynamicObject(2197,Cabs[h][0],Cabs[h][1],Cabs[h][2],0,0,Cabs[h][3],house+50,HouseInfo[house][hInt]);
						}
						else printf("Внимание! Дом №%i имеет стиль: -1", house);
					}
					PlayerSpawn(playerid);
					SaveAccount(playerid);
				}
				else
				{
				    PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
					SendClientMessage(playerid,COLOR_GREY,"Для покупки этого интерьера вам нехватает денег");
					return true;
				}
			}
			else
			{
			    PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
			    SendClientMessage(playerid,COLOR_GREY,"Для покупки этого интерьера вам нехватает уровня");
                return true;
			}
		}
	}
	else if(Clother[playerid] != -1)
	{
	    new nskin = PlayerInfo[playerid][pSkin];
	    new skin = Clother[playerid];
	    if(nskin != 0)
	    {
		    new cost;
		    if(PlayerInfo[playerid][pSex] == 2) cost = GSkinCost[skin];
		    else cost = MSkinCost[skin];
		    if(cost <= 0) cost = 140;
		    if(GetMoney(playerid) >= cost)
		    {
				Clother[playerid] = -1;
				J_TogglePlayerControllable(playerid, true);
				SetPlayerPos(playerid, 199.0545,-131.5248,1003.5152);
				TogglePlayerDynamicCP(playerid, Binko_CP, true);
				PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
				GiveMoney(playerid,-cost,"Binko");
				new bizid = BizEntered[playerid];
				BizInfo[bizid][bMoney] += cost;
				SendClientMessage(playerid,COLOR_LIGHTBLUE,"Спасибо за покупку, удачного дня!");
				SetCameraBehindPlayerEx(playerid);
				SetPlayerVirtualWorld(playerid,OldWorld[playerid]);
				SettingSpawn(playerid);
				SaveBiz(bizid);
				SaveAccount(playerid);
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Для покупки этого костюма вам нехватает денег");
			    PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
			    return true;
			}
		}
		else
		{
		    TutState[playerid] = -1;
			for(new i; i < 100; i ++) SendClientMessage(playerid, -1, "\n");
			IntroState[playerid] = 0;
			GangZoneShowForPlayer(playerid, HideMapZone, 0x000000FF);
			SetPlayerCameraPos(playerid, -1795.0, 1735.0, -99.0);
			SetPlayerCameraLookAt(playerid, -1795.7684, 1735.3344, -100.0);
			SetFullness(playerid, 30);
			SetPlayerWeather(playerid, 0);
			SetPlayerTime(playerid, 15, 0);
			PlayerTextDrawBoxColor(playerid, DeathDraw[playerid], 0x000000FF);
			PlayerTextDrawShow(playerid, DeathDraw[playerid]);
			IntroTimer[playerid] = SetTimerEx("ToggleSpectating", 1000, false, "ii", playerid, 1);
		    Clother[playerid] = -1;
		    PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
		    J_TogglePlayerControllable(playerid, true);
		    SaveAccount(playerid);
		}
	}
	else if(SpecCamID[playerid] != -1)
	{
	    SpecCamID[playerid] = -1;
	    SetCameraBehindPlayerEx(playerid);
	    SetPlayerInterior(playerid,6);
	}
	else if(SelectMobile[playerid] != -1)
	{
	    new string[100];
	    new select = SelectMobile[playerid];
	    DestroyPlayerObject(playerid, SelectMobileObj[playerid]);
	    SelectMobileObj[playerid] = -1;
		PlayerTextDrawHide(playerid, InfoText[playerid]);
		TextDrawHideForPlayer(playerid, BuyPhoneText);
		format(string, sizeof(string), "Вы купили мобильный телефон '%s' за $%d",GetPhoneName(select), MobilePrice[select]);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		SetCameraBehindPlayerEx(playerid);
	}
	else if(BuyGuns[playerid] != -1)
	{
	    new string[100];
	    new bgid = BuyGuns[playerid];
	    new ammo = BuyGunAmmo[playerid];
	    new Float:flprice = float(BuyGunInfo[bgid][bgPrice]);
	    new Float:flammo = float(BuyGunInfo[bgid][bgAmmo][0]);
	    new weaponid = BuyGunInfo[bgid][bgGunid];
		new ammos = BuyGunInfo[bgid][bgAmmo][ammo];
	    new money = floatround( (flprice / flammo) * float(BuyGunInfo[bgid][bgAmmo][ammo]) );
	    if(!gexist(playerid, weaponid)) money += BuyGunInfo[bgid][bgGPrice];
	    else if(weaponid < 15)
	    {
	        SendClientMessage(playerid, COLOR_GREY, "У вас уже есть данное оружие.");
	        return true;
	    }
	    else
	    {
			new w, a, slot = GetWeaponSlot(weaponid);
			GetPlayerWeaponData(playerid, slot, w, a);
			new allammo = BuyGunInfo[bgid][bgAmmo][ammo] + a;
			if(allammo > MaxAmmo[weaponid])
			{
			    new unammo = (MaxAmmo[weaponid] - a);
			    money = floatround( float(money) / float(ammos) * float(unammo) );
			    ammos = unammo;
			}
	    }
	    if(GetMoney(playerid) < money)
		{
			SendClientMessage(playerid, COLOR_GREY, "У вас недостаточно средств");
			PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
			return true;
		}
	    PlayerTextDrawHide(playerid, InfoText[playerid]);
	    DestroyPlayerObject(playerid, TempBGObject[playerid]);
	    TempBGObject[playerid] = -1;

	    new weapon = J_GivePlayerWeapon(playerid, weaponid, ammos);
	    if(weapon != -1)
	    {
		    GiveMoney(playerid, -money, "BuyGun");
		    new biz = BizEntered[playerid];
		    if(biz != -1)
			{
				new Float:products = money / 1.8;
				if(BizInfo[biz][bProducts] < products) return SendClientMessage(playerid, COLOR_GREY, "В ганшопе не хватает продуктов");
			    BizInfo[biz][bProducts] -= floatround(products);
				BizInfo[biz][bMoney] += money;
				SaveBiz(biz);
			}
		    format(string, sizeof(string), "Вы купили %s с %d боеприпасами за $%d", WeaponNames[weaponid], ammos, money);
		    SendClientMessage(playerid, COLOR_WHITE, string);
			SendClientMessage(playerid, COLOR_GREY, "Купить оружие вы сможете только через 10 минут");
		    BuyGuns[playerid] = -1;
		    ResetBuyGuns[playerid] = 600;
		    SetCameraBehindPlayerEx(playerid);
		    SaveAccount(playerid);
		    PlayerPlaySound(playerid, 30800, 0.0, 0.0, 0.0);
	    }
	    else
	    {
	        SendClientMessage(playerid, COLOR_GREY, "Нельзя носить более 4-х едениц оружия");
	    }
	}
	else if(BuyingCar[playerid] != -1)
	{
	    new string[150];
		new leader = PlayerInfo[playerid][pLeader];
	    new buy = BuyingCar[playerid];
	    new nummodel = BuyingModel[playerid];
	    new model = BuyTCModels[leader][nummodel];
	    if(BuyTeamCars[leader][bcPos_X][buy] != 0)
	    {
	        new price = GetTeamCarCost(BuyTCModels[leader][nummodel]);
	        if(TeamCar[leader][buy] == 0)
	        {
		        if(GetMoney(playerid) >= price)
		        {
		            DestroyVehicleEx(PlayerBuyTC[playerid]);
		            PlayerBuyTC[playerid] = -1;
		            format(string, sizeof(string), "{FFFFFF}Вы хотите купить транспорт для банды/мафии?\nМодель: %s\nЦена: $%d",
		            GetVehicleName(model), price);
		            ShowPlayerDialogEx(playerid, 72, 0, "Покупка транспорта", string, "Купить", "Отмена");
				}
				else return SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег");
			}
			else
			{
			    new cost = price - GetTeamCarCost( GetVehicleModel(TeamCar[leader][buy]) );
			    if(cost < 0) cost = 0;
			    if(GetMoney(playerid) >= cost)
		        {
		            DestroyVehicleEx(PlayerBuyTC[playerid]);
		            PlayerBuyTC[playerid] = -1;
		            format(string, sizeof(string), "{FFFFFF}Вы хотите заменить транспорт для банды/мафии?\nМодель: %s\nДоплата: $%d",
		            GetVehicleName(model), cost);
		            ShowPlayerDialogEx(playerid, 72, 0, "Замена транспорта", string, "Замена", "Отмена");
				}
				else return SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег");
			}
		}
		else return SendClientMessage(playerid, COLOR_GREY, "Ошибка при покупке");
	}
	PlayerTextDrawHide(playerid,InfoText[playerid]);
	TextDrawHideForPlayer(playerid,ButtonLeft);
	TextDrawHideForPlayer(playerid,ButtonRight);
	TextDrawHideForPlayer(playerid,ButtonUp);
	TextDrawHideForPlayer(playerid,ButtonDown);
	TextDrawHideForPlayer(playerid,ButtonCancel);
	TextDrawHideForPlayer(playerid,ButtonSelect);
	CancelSelectTextDraw(playerid);
	return true;
}

COMMAND:cancel(playerid, params[])
{
    if(CreateHouse[playerid][chInt] != -1)
 	{
 	    J_TogglePlayerSpectating(playerid, false);
		PlayerTextDrawHide(playerid,InfoText[playerid]);
		CreateHouse[playerid][chInt] = -1;
		PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
 	}
    else if(BuyInt[playerid] != -1)
 	{
		BuyInt[playerid] = -1;
		J_TogglePlayerSpectating(playerid, false);
		PlayerTextDrawHide(playerid,InfoText[playerid]);
		PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	}
	else if(Clother[playerid] != -1)
	{
	    new nskin = PlayerInfo[playerid][pSkin];
	    if(nskin != 0)
	    {
	        SetPlayerPos(playerid, 199.0545, -131.5248, 1003.5152);
	        Clother[playerid] = -1;
			J_TogglePlayerControllable(playerid, true);
			SetPlayerSkin(playerid, PlayerInfo[playerid][pOldSkin]);
			SetCameraBehindPlayerEx(playerid);
	  		SetPlayerVirtualWorld(playerid,OldWorld[playerid]);
			TogglePlayerDynamicCP(playerid, Binko_CP, true);
			PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
	    }
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Вы должны выбрать скин");
		    return true;
		}
	}
	else if(SpecCamID[playerid] != -1)
	{
	    SpecCamID[playerid] = -1;
	    SetCameraBehindPlayerEx(playerid);
	    SetPlayerInterior(playerid,6);
	}
	else if(SelectMobile[playerid] != -1)
	{
	    DestroyPlayerObject(playerid, SelectMobileObj[playerid]);
	    SelectMobileObj[playerid] = -1;
		PlayerTextDrawHide(playerid, InfoText[playerid]);
		TextDrawHideForPlayer(playerid, BuyPhoneText);
		SendClientMessage(playerid, COLOR_GREY, "Вы отказались покупать мобильный телефон");
		PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
		SetCameraBehindPlayerEx(playerid);
	}
	else if(BuyGuns[playerid] != -1)
	{
	    BuyGuns[playerid] = -1;
	    PlayerTextDrawHide(playerid, InfoText[playerid]);
	    DestroyPlayerObject(playerid, TempBGObject[playerid]);
	    TempBGObject[playerid] = -1;
	    SendClientMessage(playerid, COLOR_WHITE, "Вы отказались покупать оружие");
	    PlayerPlaySound(playerid, 30802, 0.0, 0.0, 0.0);
		SetCameraBehindPlayerEx(playerid);
	}
	else if(BuyingCar[playerid] != -1)
	{
	    SendClientMessage(playerid, COLOR_WHITE, "Вы отказались покупать транспорт");
	    J_TogglePlayerSpectating(playerid, false);
	    DestroyVehicleEx(PlayerBuyTC[playerid]);
	    PlayerBuyTC[playerid] = -1;
	    BuyingCar[playerid] = -1;
	    BuyingModel[playerid] = -1;
	}
	PlayerTextDrawHide(playerid,InfoText[playerid]);
	TextDrawHideForPlayer(playerid,ButtonLeft);
	TextDrawHideForPlayer(playerid,ButtonRight);
	TextDrawHideForPlayer(playerid,ButtonUp);
	TextDrawHideForPlayer(playerid,ButtonDown);
	TextDrawHideForPlayer(playerid,ButtonCancel);
	TextDrawHideForPlayer(playerid,ButtonSelect);
	CancelSelectTextDraw(playerid);
	return true;
}

/*COMMAND:fixmycar(playerid, params[])
{
	if(PlayerInfo[playerid][pVIP] >= STATUS_VIP)
	{
	    new car;
		if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /fixmycar [id]");
		if(IsPlayerHaveCar(playerid,car))
		{
	    	SetVehicleToRespawn(car);
	    	SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы зареспавнили личный транспорт");
	    }
	    else SendClientMessage(playerid,COLOR_GREY,"Это не ваш транспорт");
	}
	else SendClientMessage(playerid,COLOR_GREY,"Эта функция доступна только для игроков с VIP статусом");
	return true;
}

COMMAND:getmycar(playerid, params[])
{
	if(PlayerInfo[playerid][pVIP] >= STATUS_GOLD)
	{
    	new car,Float:X,Float:Y,Float:Z;
		if(sscanf(params,"d",car)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используй: /getmycar [id]");
		if(IsPlayerHaveCar(playerid,car))
		{
		    GetPlayerPos(playerid,X,Y,Z);
		    J_SetVehiclePos(car,X,Y,Z);
		    J_SetPlayerPos(playerid,X,Y,Z+2);
		    return true;
		}
		else SendClientMessage(playerid,COLOR_GREY,"Это не ваш транспорт");
	}
	else SendClientMessage(playerid,COLOR_GREY,"Эта функция доступна только для игроков с Gold статусом");
	return false;
}*/

/*
COMMAND:openvorota(playerid, params[])
	{
		if(IsPlayerConnected(playerid))
		{
			if(IsPlayerInRangeOfPoint(playerid, 7.0, 2127.810302,-2133.813476,21.401819))
			{
				if(GetTeamID(playerid) == TEAM_LICENSERS || PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
				{
					MoveObject(obj_slak, 2127.810302,-2133.813476,21.401819+0.004, 0.004, 0.000000,0.000000,0.000000);
        			timershlak1 = SetTimer("ShlakTimer1",5000,false);
				}
				else{SendClientMessage(playerid, COLOR_GREY, "Ошибка: Вы не являетесь сотрудником АвтоШколы");}
			}
		 	else if(IsPlayerInRangeOfPoint(playerid, 7.0, 2178.331054,-2227.659423,21.739364))
			{
				if(GetTeamID(playerid) == TEAM_LICENSERS || PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
				{
					MoveObject(obj_slak2, 2173.010009,-2228.530029,21.760000+0.004, 0.004, 0.000000,0.000000,0.000000);
        			timershlak2 = SetTimer("ShlakTimer2",5000,false);
				}
				else{SendClientMessage(playerid, COLOR_GREY, "Ошибка: Вы не являетесь сотрудником АвтоШколы");}
			}
		 	else if(IsPlayerInRangeOfPoint(playerid, 7.0, 2580.2517,-2435.3606,21.7871))
			{
				if(GetTeamID(playerid) == TEAM_LSPD || PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
				{
					MoveObject(vorota, 2579.855468,-2443.397705,22.39464, 3.0);
        			SetTimer("GateClosee", 5000, 0);
				}
				else{SendClientMessage(playerid, COLOR_GREY, "Ошибка: Вы не являетесь сотрудником Полиций");}
			}
		}
		return 1;
	}
*/
COMMAND:opengate(playerid, params[])
{
	new string[100];
    if(OGReset[playerid] > 0) return true;
    OGReset[playerid] = 2;
	if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
	{
	    if(GetTeamID(playerid) == TEAM_LICENSERS)
	    {
	        if(IsPlayerInRangeOfPoint(playerid, 7.0, -2051.8867, -80.5019, 34.8640))
	        {
	            new anim[32], lib[32];
		        GetAnimationName(GetPlayerAnimationIndex(playerid), lib, 32, anim, 32);
	            if(!LicBarrierOpen)
	        	{
		            if(!strcmp(anim, "SEAT_DOWN", true))
			       	{
			       	    format(string, sizeof(string), "* %s открывает шлагбаум", cPN(playerid));
						ProxDetector(10.0, playerid, string, COLOR_PURPLE);
					}
	        	    MoveObject(LicensersBarrier,-2051.8867, -80.5019, 34.8640, BARRIER_SPEED, 0.0, 0.0, 0.0);
					LicBarrierOpen = true;
					SendClientMessage(playerid,COLOR_LIGHTGREEN,"Нажмите H повторно, чтобы закрыть шлагбаум");
	            }
				else
				{
				    if(!strcmp(anim, "SEAT_DOWN", true))
			       	{
			       	    format(string, sizeof(string), "* %s закрывает шлагбаум", cPN(playerid));
						ProxDetector(10.0, playerid, string, COLOR_PURPLE);
					}
				    LicBarrierClose();
				}
				return true;
	        }
	    }
	    new forcount = MuchNumber(sizeof(GateInfo), sizeof(BarrierInfo));
	    for(new i;i < forcount;i ++)
		{
		    if(i < sizeof(GateInfo))
		    {
		        if(GateInfo[i][gCreated])
		        {
					if(IsPlayerInRangeOfPoint(playerid,7.0,GateInfo[i][gClose_X],GateInfo[i][gClose_Y],GateInfo[i][gClose_Z]))
					{
						if(GateInfo[i][gOrg] == TEAM_NONE || GetTeamID(playerid) == GateInfo[i][gOrg] || ( IsACopGate(i) && IsACop(playerid) ) || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
						{
							if(!GateInfo[i][gOpen])
							{
							    UpdateDynamic3DTextLabelText(GateText[i], COLOR_LIME, "*** Ворота ***");
								MoveObject(gGate[i],GateInfo[i][gOpen_X],GateInfo[i][gOpen_Y],GateInfo[i][gOpen_Z],3.0);
								SetTimerEx("GateClose",6000,0,"i",i);
								GateInfo[i][gOpen] = true;
								SendClientMessage(playerid,COLOR_LIGHTGREEN,"Ворота закроются через 5 секунд");
								if(GateInfo[i][gForGateid] != -1)
								{
								    new gateid = GateInfo[i][gForGateid];
								    UpdateDynamic3DTextLabelText(GateText[gateid], COLOR_LIME, "*** Ворота ***");
								    MoveObject(gGate[gateid],GateInfo[gateid][gOpen_X],GateInfo[gateid][gOpen_Y],GateInfo[gateid][gOpen_Z],3.0);
									GateInfo[gateid][gOpen] = true;
								}
							}
						}
						else
						{
						    format(string, sizeof(string), "Вы не состоите в организации \"%s\"", TeamName(GateInfo[i][gOrg]));
						    SendClientMessage(playerid, COLOR_GREY, string);
						}
						break;
					}
				}
			}
			if(i < sizeof(BarrierInfo))
			{
				if(IsPlayerInRangeOfPoint(playerid,7,BarrierInfo[i][brPos_X],BarrierInfo[i][brPos_Y],BarrierInfo[i][brPos_Z]))
				{
					if(BarrierInfo[i][brOrg] == TEAM_NONE || GetTeamID(playerid) == BarrierInfo[i][brOrg] || ( IsACopBarrier(i) && IsACop(playerid) ) || PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
					{
						if(!BarrierInfo[i][brOpen])
						{
						    UpdateDynamic3DTextLabelText(BarrierText[i], COLOR_LIME, "*** Шлагбаум ***");
							MoveObject(gBarrier[i],BarrierInfo[i][brPos_X],BarrierInfo[i][brPos_Y],BarrierInfo[i][brPos_Z]+0.7,BARRIER_SPEED,0.0,0.0,BarrierInfo[i][brPos_A]+180);
							SetTimerEx("BarrierClose",6000,0,"i",i);
							BarrierInfo[i][brOpen] = true;
							SendClientMessage(playerid,COLOR_LIGHTGREEN,"Шлагбаум закроется через 5 секунд");
							if(BarrierInfo[i][brForBarrierID] != -1)
							{
							    new barrierid = BarrierInfo[i][brForBarrierID];
							    UpdateDynamic3DTextLabelText(BarrierText[barrierid], COLOR_LIME, "*** Шлагбаум ***");
							    MoveObject(gBarrier[barrierid],BarrierInfo[barrierid][brPos_X],BarrierInfo[barrierid][brPos_Y],BarrierInfo[barrierid][brPos_Z]+0.7,BARRIER_SPEED,0.0,0.0,BarrierInfo[barrierid][brPos_A]+180);
								BarrierInfo[barrierid][brOpen] = true;
							}
						}
					}
					else
					{
					    format(string, sizeof(string), "Вы не состоите в организации \"%s\"", TeamName(BarrierInfo[i][brOrg]));
					    SendClientMessage(playerid, COLOR_GREY, string);
					}
					break;
				}
			}
		}
	}
	return true;
}

COMMAND:inhouse(playerid, param[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new house;
		if(sscanf(param,"d",house)) return SendClientMessage(playerid,-1,"Используй /inhouse [0-554]");
		if(house >= 0 && house < OWNABLEHOUSES)
		{
		    HouseEntered[playerid] = house;
		    J_SetPlayerPos(playerid,HouseInfo[house][hExit_X],HouseInfo[house][hExit_Y],HouseInfo[house][hExit_Z]);
		    SetPlayerInterior(playerid,HouseInfo[house][hInt]);
		    SetPlayerVirtualWorld(playerid,house+50);
		    return true;
		}
	}
	return false;
}

COMMAND:houseint(playerid, param[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
		new interior;
		if(sscanf(param,"d",interior)) return SendClientMessage(playerid,-1,"Используй /houseint [1-15]");
		J_SetPlayerPos(playerid,GHSPos[interior][0],GHSPos[interior][1],GHSPos[interior][2]);
		SetPlayerInterior(playerid,interior);
	}
	return true;
}

COMMAND:sex(playerid, params[])
{
	new id, string[100];
	if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /sex [ID]");
	if(id != playerid)
	{
		SexOffer[id] = playerid;
		new Float:x, Float:y, Float:z;
	   	GetPlayerPos(id, x, y, z);
		if(IsPlayerInRangeOfPoint(playerid,1.5,x,y,z))
		{
			if(GetPlayerSex(playerid) != GetPlayerSex(id))
			{
			    if(!Sex[playerid] && !Sex[id])
			    {
					format(string, sizeof(string), "%s предложил вам заняться сексом в отеле\n Вы согласны ?",PN(playerid));
					if(!ShowPlayerDialogEx(id,150,DIALOG_STYLE_MSGBOX,"Предложение заняться сексом",string,"Да","Нет"))
					{
					    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
					}
				}
				else SendClientMessage(playerid,COLOR_GREY,"Этот игрок или вы уже занимаетесь сексом...");
			}
			else SendClientMessage(playerid,COLOR_GREY,"На нашем сервере нельзя заниматься однополым сексом");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы далеко от игрока с которым хотите занятся сексом");
	}
	return true;
}


COMMAND:flip(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    if(IsPlayerInAnyVehicle(playerid))
	    {
	        new Float:A;
	        GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
	        SetVehicleZAngle(GetPlayerVehicleID(playerid),A);
	    }
	}
	return true;
}

COMMAND:gotohouse(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_SUPER_ADMIN)
	{
		new id;
		if(sscanf(params,"d",id)) return true;
		J_SetPlayerPos(playerid, HouseInfo[id][hEnter_X], HouseInfo[id][hEnter_Y], HouseInfo[id][hEnter_Z]);
	}
	return true;
}

COMMAND:sethint(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id,int;
		if(sscanf(params,"dd",id,int)) return true;
		SetHouseInt(id,int);
		SaveHouse(id);
	}
	return true;
}

COMMAND:carcolor(playerid, params[])
{
	if(IsPlayerInHisVehicle(playerid))
	{
	    if(GetMoney(playerid) >= 100)
	    {
		    new carid = GetPlayerVehicleID(playerid);
		    new vehid = GetVehicleID(carid);
		    new color_1,color_2;
		    if(sscanf(params,"dd",color_1,color_2)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /carcolor [цвет 1] [цвет 2]");
		    ChangeVehicleColor(carid, color_1, color_2);
		    CarInfo[vehid][cColor_1] = color_1;
		    CarInfo[vehid][cColor_2] = color_2;
		    GiveMoney(playerid,-100,"CarColor");
		    SaveOwnableCar(vehid);
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "У вас нехватает денег");
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы не в собственном транспорте");
	return true;
}

COMMAND:my_gps(playerid, params[])
{
	new string[1000];
	CountGPS[playerid] = 0;
	for(new i;i < MAX_GPS;i ++)
	{
	    if(!GetString(GPSName[playerid][i],"No_Gps_Name"))
	    {
	        strcat(string, GPSName[playerid][i]);
	        strcat(string, "\n");
	        CountGPS[playerid] ++;
	    }
	}
	strcat(string, "{33CCFF}Добавить позицию");
	if(!ShowPlayerDialogEx(playerid, 244, 2, "{33CCFF}My GPS", string, "Выбор", "Отмена"))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:eject(playerid, params[])
{
	new id, string[100];
	if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /eject [ID/Name]");
	if(GetPlayerState(playerid) == 2)
	{
	    if(IsPlayerInVehicle(id, GetPlayerVehicleID(playerid)))
	    {
			if(!Seatbelt[id])
			{
				new power = random(10);
				if(power > 5)
				{
					format(string, sizeof(string), "* %s неудачно попытался выкинуть из транспорта игрока %s", cPN(playerid), cPN(id));
					ProxDetector(10.0, playerid, string, COLOR_PURPLE);
				}
				else
				{
				    Gag[id] = false;
				    KnockoutTick[id] = 0;
					Knockout[id] = false;
					J_TogglePlayerControllable(id, true);
				    GangZoneHideForPlayer(id, HideMapZone);
					SetCameraBehindPlayerEx(playerid);
					format(string, sizeof(string), "* %s выкинул из транспорта игрока %s", cPN(playerid), cPN(id));
					ProxDetector(10.0, playerid, string, COLOR_PURPLE);
					J_RemovePlayerFromVehicle(id);
				}
			}
			else SendClientMessage(playerid, COLOR_GREY, "Этот игрок пристегнут");
		}
	}
	else SendClientMessage(playerid, COLOR_GREY, "Только водитель может сделать это");
	return true;
}

COMMAND:changerank(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0)
	{
	    if(ChangeRankID[playerid] != -1)
	    {
			if(!ShowPlayerDialogEx(playerid, 266, 0, "{FF0000}Предупреждение", "{FFFFFF}Вы уже подали запрос на смену одного из рангов!\nХотите {FF0000}отменить{FFFFFF} его и сменить другой ранг?", "Да", "Нет"))
			{
			    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
			}
		    return true;
		}
	    new leader = PlayerInfo[playerid][pLeader];
		new string[500], rank[50];
		for(new i = 0; i < 13; i ++)
		{
		    format(rank, sizeof(rank), "%i. %s\n", i+1, GetRankName(leader, i+1));
		    strcat(string, rank);
		}
		if(!ShowPlayerDialogEx(playerid, 261, 2, "Смена рангов", string, "Сменить", "Назад"))
		{
		    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
		}
	}
	return true;
}

COMMAND:resmedcards(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    for(new i; i < GetMaxPlayersEx(); i ++)
	    {
	        if(!IsPlayerConnected(i)) continue;
	        if(!IsPlayerLogged[i]) continue;
			MedCardInfo[i][mcState] = -1;
	    }
	}
	return true;
}

COMMAND:getpcity(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id, string[100];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /getpcity [ID/Name]");
		format(string, sizeof(string), "Город игрока %s: %s",PN(id), GetPlayerCity(id));
		SendClientMessage(playerid, COLOR_GREY, string);
	}
	return false;
}

COMMAND:getpountry(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id, string[100];
		if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /getpountry [ID/Name]");
		format(string, sizeof(string), "Страна игрока %s: %s",PN(id), GetPlayerCountry(id));
		SendClientMessage(playerid, COLOR_GREY, string);
	}
	return false;
}

COMMAND:addupdate(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new date[15], text[150], string[100];
	    if(sscanf(params, "s[15]s[150]", date, text)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /addupdate [ Дата ] [ Текст ]");
	    SendClientMessage(playerid, COLOR_WHITE, "_____________________________________ Вы успешно добавили запись _____________________________________");
		format(string, sizeof(string), "Дата: {FF9900}%s", date);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		format(string, sizeof(string), "Запись: {FF9900}%s", text);
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	    SendClientMessage(playerid, COLOR_WHITE, "_______________________________________________________________________________________________________");
        strins(text, "- ", 0), strcat(text, "\n");
		format(string, sizeof(string), "[Updates]/%s.ini", date);
		WriteFile(string, text);
	}
	return true;
}

COMMAND:hack(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		return ShowPlayerDialogEx(playerid, 10000, 0, "Диалог для взлома", "Диалог для взлома (ID: 10000)\n\n- Сверните игру\n- Нажмите в ArtMoney 'Искать'\n- Введите 10000\n- Нажмите 'Ок'\n- Разверните игру\n- Нажмите 'Далее'", "Далее", "Отмена");
	}
	return false;
}

COMMAND:yesrank(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[200];
	    if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /yesrank [id]");
	    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в сети");
	   	if(!PlayerInfo[id][pLeader]) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в лидер");
	   	if(!strlen(ChangeRank[id])) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не подавал заявку на смену ранга");
	   	new leader = PlayerInfo[id][pLeader];
	   	new rank = ChangeRankID[id];
	   	format(string, sizeof(string), "Вы одобрили лидеру %s смену ранга {AFAFAF}%s(%i){FFFFFF} на %s", PN(id), RankName[leader][rank], rank + 1, ChangeRank[id]);
		SendClientMessage(playerid, COLOR_WHITE, string);
		format(string, sizeof(string), "Администратор %s одобрил смену ранга %s(%i){FFFFFF} на %s", PN(playerid), RankName[leader][rank], rank + 1, ChangeRank[id]);
		SendClientMessage(id, COLOR_WHITE, string);
		SetString(RankName[leader][rank], ChangeRank[id]);
		format(string, sizeof(string), "UPDATE `OrgsInfo` SET `Rank_%i` = '%s' WHERE `ID` = '%i'", ChangeRankID[id] + 1, ChangeRank[id], leader);
		mysql_query(string);
		ChangeRank[id] = "";
		ChangeRankID[id] = -1;
	}
	return true;
}

COMMAND:norank(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[200], reason[50];
	    if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /norank [id] [причина]");
	    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в сети");
	   	if(!PlayerInfo[id][pLeader]) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в лидер");
	   	if(!strlen(ChangeRank[id])) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не подавал заявку на смену ранга");
	   	new leader = PlayerInfo[id][pLeader];
	   	new rank = ChangeRankID[id];
	   	format(string, sizeof(string), "Вы отклонили запрос лидера %s на смену ранга {AFAFAF}%s(%i){FFFFFF} на %s", PN(id), RankName[leader][rank], rank + 1, ChangeRank[id]);
		SendClientMessage(playerid, COLOR_WHITE, string);
		format(string, sizeof(string), "Администратор %s отклонил запрос на смену ранга {AFAFAF}%s(%i){FFFFFF} на %s", PN(playerid), RankName[leader][rank], rank + 1, ChangeRank[id]);
		SendClientMessage(id, COLOR_WHITE, string);
		format(string, sizeof(string), "Причина отклонения: %s", reason);
		SendClientMessage(playerid, COLOR_GREY, string);
		SendClientMessage(id, COLOR_GREY, string);
		ChangeRank[id] = "";
		ChangeRankID[id] = -1;
	}
	return true;
}

new carobj;
COMMAND:aotv(playerid, params[])
{
	if(GetString(PN(playerid), "Jensen_Ackles"))
	{
	    if(IsPlayerLogged[playerid])
	    {
		    new carid = GetPlayerVehicleID(playerid);
		    new id, Float:pos[6];
		    sscanf(params,"dffffff", id, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5]);
			DestroyObject(carobj);
		    carobj = CreateObject(id, 0, 0, 0, 0, 0, 0);
		    AttachObjectToVehicle(carobj, carid, pos[0], pos[1], pos[2], pos[3], pos[4], pos[5]);
		    SendClientMessage(playerid, COLOR_LIME, "Вы прикрепили объект");
	    }
	}
	return true;
}

COMMAND:setbomb(playerid, params[])
{
	if(IsACop(playerid))
	{
		if(IsPlayerInRangeOfPoint(playerid, 2.0, 1467.0257, -1009.6339, 27.5037))
		{
		    if(BankClosed)
		    {
			    if(BankBomb != -1) return SendClientMessage(playerid, COLOR_GREY, "Бомба уже установлена");
				BankBomb = CreateDynamicObject(363, 1467.0639, -1009.6619, 27.6037, 0.00, 0.00, 0.00);
				BankBombText = CreateDynamic3DTextLabel("До взрыва: {33CCFF}0:05", COLOR_WHITE, 1467.0639, -1009.6619, 27.6037, 10.0);
				SetTimerEx("ExplosionMiniBomb", 1000, false, "i", 5);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Банк не закрыт грабителями");
			}
		}
	}
	return true;
}

COMMAND:medcard(playerid, params[])
{
	new id, status, string[150];
	if(GetTeamID(playerid) == TEAM_M4C)
	{
	    if(PlayerInfo[playerid][pRank] >= 5)
	    {
	        if(sscanf(params, "ui", id, status))
			{
				SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /medcard [id] [статус]");
				SendClientMessage(playerid, COLOR_WHITE, "__________ Статусы __________");
				SendClientMessage(playerid, COLOR_RED ,  "-1. Нет мед. карты");
				SendClientMessage(playerid, COLOR_GREY , " 0. Не определен");
				SendClientMessage(playerid, COLOR_WHITE, " 1. Психически не здоров(а)");
				SendClientMessage(playerid, COLOR_WHITE, " 2. Наблюдаются отклонения");
				SendClientMessage(playerid, COLOR_WHITE, " 3. Полностью здоровый(ая)");
				return true;
			}
			if(IsPlayerConnected(id))
			{
			    if(IsPlayerLogged[id])
			    {
			        if(IsValidPassport(id))
			        {
			            new Med[30];
			            MedCardInfo[id][mcState] = status;
						switch(MedCardInfo[id][mcState])
						{
						    case -1: Med = "Нет мед. карты";
						    case 0: Med = "Не определен";
						    case 1: Med = "Психически не здоров(а)";
						    case 2: Med = "Наблюдаются отклонения";
						    case 3: Med = "Полностью здоровый(ая)";
						}
				        SetString(MedCardInfo[id][mcGiver], PN(playerid) );
				        new year, month, day;
				        getdate(year, month, day);
				        format(string, sizeof(string), "%i/%i/%i", day, month, year);
				        SetString(MedCardInfo[id][mcDate], string );
				        format(string, sizeof(string), "Медик %s выдал вам медицинскую карту: %s", PN(playerid), Med );
				        SendClientMessage(id, COLOR_LIGHTBLUE, string);
				        format(string, sizeof(string), "Вы выдали медицинскую карту игроку %s: %s", PN(id), Med );
				        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

                        format(string, sizeof(string), "UPDATE `Passports` SET `McGiver` = '%s', `McDate` = '%s', `McState` = '%d' WHERE `Name` = '%s'",
                        MedCardInfo[id][mcGiver],
                        MedCardInfo[id][mcDate],
                        MedCardInfo[id][mcState],
						PN(id));
                        mysql_query(string);
			        }
			        else SendClientMessage(playerid, COLOR_GREY, "У этого игрока нет паспорта.");
			    }
			}
			else SendClientMessage(playerid, COLOR_GREY, "Этот игрок не в сети.");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Ваш ранг недостаточно высок для этого.");
	}
	return true;
}

COMMAND:showdis(playerid, params[])
{
	if(!ShowDistance[playerid]) ShowDistance[playerid] = true;
	else ShowDistance[playerid] = false;
	return true;
}


COMMAND:showdamage(playerid, params[])
{
	if(!ShowDamage[playerid]) ShowDamage[playerid] = true;
	else ShowDamage[playerid] = false;
	return true;
}
COMMAND:savebizes(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < ADM_GRAND_ADMIN) return true;
	for(new i; i < OWNABLEBIZES; i ++)
	{
	    SaveBiz(i);
	}
	return true;
}

/////////
CMD:bombme(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
    	PlayerInfo[playerid][pBomb] = 1;
    }
    return true;
}
/////////

COMMAND:anglecar(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[30];
	    sscanf(params, "i", id);
	    new Float:X, Float:Y, Float:Z;
	    GetVehiclePos(id, X, Y, Z);
		new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
		format(string, sizeof(string),"Angle = %f", angle);
		SendClientMessage(playerid, -1, string);
	}
	return true;
}

COMMAND:angleplayer(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, string[30];
	    sscanf(params, "i", id);
	    new Float:X, Float:Y, Float:Z;
	    GetPlayerPos(id, X, Y, Z);
		new Float:angle = GetPlayerAngleToPoint(playerid, X, Y);
		format(string, sizeof(string),"Angle = %f", angle);
		SendClientMessage(playerid, -1, string);
	}
	return true;
}

COMMAND:createnpc(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new string[24];
	    GetPlayerPos(playerid, NPCPos[CountNPC][0], NPCPos[CountNPC][1], NPCPos[CountNPC][2]);
	    format(string, sizeof(string),"CreatedBot_%d", CountNPC);
	    ConnectNPC(string, "blank");
	    CountNPC ++;
	}
	return true;
}

COMMAND:bomb(playerid, params[])
{
	if(PlayerInfo[playerid][pBomb] > 0)
	{
		new time, string[120];
		if(sscanf(params,"d",time)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /bomb [таймер (сек)]");
		if(time >= 10 && time <= 300)
		{
		    new bombid = MAX_BOMBS;
		    for(new i; i < MAX_BOMBS;i ++)
		    {
		        if(!BombInfo[i][bbCreated])
		        {
	                bombid = i;
	                break;
		        }
		    }
		    if(bombid < MAX_BOMBS)
		    {
		        new Float:X, Float:Y, Float:Z;
		        GetPlayerPos(playerid, X, Y, Z);
		        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 1, 0, 0, 0, 1);
		        format(string, sizeof(string),"Вы заложили бомбу. Таймер на %s", Convert(time));
		        SendClientMessage(playerid, COLOR_LIME, string);
		        BombInfo[bombid][bbCreated] = true;
		        BombInfo[bombid][bbTime] = time;
		        format(string, sizeof(string),"{FFFFFF}*** Бомба ***\n{FF9900}%s", Convert(time));
		        BombInfo[bombid][bbText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z, 10.0);
		        BombInfo[bombid][bbObject] = CreateDynamicObject(1252, X, Y, Z, 0, 0, 0);
		        BombInfo[bombid][bbPos][0] = X;
		        BombInfo[bombid][bbPos][1] = Y;
		        BombInfo[bombid][bbPos][2] = Z;
		        PlayerInfo[playerid][pBomb] --;
		    }
		}
		else SendClientMessage(playerid, COLOR_GREY, "Не больше 300 и не меньше 10");
	}
	else SendClientMessage(playerid, COLOR_GREY, "У вас нет бомбы");
	return true;
}

COMMAND:unbomb(playerid, params[])
{
	if(IsACop(playerid))
	{
		if(BreakBomb[playerid] == -1)
		{
			for(new i; i < MAX_BOMBS; i ++)
			{
			    if(BombInfo[i][bbCreated] && !BombInfo[i][bbBreak])
			    {
			    	if(IsPlayerInRangeOfPoint(playerid, 1.0, BombInfo[i][bbPos][0], BombInfo[i][bbPos][1], BombInfo[i][bbPos][2]))
			    	{
			    	    BombInfo[i][bbBreak] = true;
			    	    BreakBomb[playerid] = i;
			    	    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 1, 1, 0, 0, 0, 1);
						SetTimerEx("UnBombPlayer", 5000, false, "ii", playerid, i);
						Controllable[playerid] = false;
						GetPlayerPos(playerid,PlayerInfo[playerid][pCPos_X],PlayerInfo[playerid][pCPos_Y],PlayerInfo[playerid][pCPos_Z]);
			    	    break;
			    	}
			    }
			}
		}
	}
	return true;
}

COMMAND:drip(playerid, params[])
{
	new weapons, ammo;
	GetPlayerWeaponData(playerid, 1, weapons, ammo);
	if(weapons == 6)
	{
		if(IsPlayerInDynamicArea(playerid, GoldZone))
		{
	    	for(new i; i < sizeof(GoldPos); i ++)
	    	{
	    	    if(GoldPos[i][0] == 0.0 && GoldPos[i][1] == 0) continue;
	    	    new Float:distance = GetPlayerDistanceFromGold(playerid, i);
	    	    if(distance < 2)
	    	    {
	    	        RemovePlayerAttachedObjectEx(playerid, 0);
	    	        SetPlayerArmedWeapon(playerid, 6);
					GoldFind[playerid] = false;
					SendClientMessage(playerid, COLOR_WHITE, "Вы начали копать золото.");
					for(new t; t < 16; t ++)
					{
						TextDrawHideForPlayer(playerid, GoldDraw[0][t]);
						TextDrawHideForPlayer(playerid, GoldDraw[1][t]);
					}
					GoldDrip[playerid] = i;
					GoldDripTick[playerid] = GetTickCount();
					ApplyAnimation(playerid, "CHAINSAW", "CSAW_G", 4.1, 1, 1, 1, 1, 0, 1);
					TextDrawHideForPlayer(playerid, EnterDrip);
					break;
	    	    }
	    	}
	    }
	    else SendClientMessage(playerid, COLOR_GREY, "Вы не в зоне раскопок");
	}
	else SendClientMessage(playerid, COLOR_GREY, "У вас нет лопаты");
	return true;
}

COMMAND:findgold(playerid, params[])
{
	if(PlayerInfo[playerid][pFeFinder])
	{
	    if(!GoldFind[playerid] && GoldDrip[playerid] == -1)
		{
			if(IsPlayerInDynamicArea(playerid, GoldZone))
			{
			    if(!IsPlayerInAnyVehicle(playerid))
			    {
				    SetPlayerAttachedObjectEx(playerid, 0, 16782, 1, 0.09, 0.45, 0.0, 90.0, 0.0, 0.0, 0.2, 0.2, 0.2);
				    GoldFind[playerid] = true;
				    FindedGold[playerid] = -1;
				    SendClientMessage(playerid, COLOR_ORANGE, "Вы начали искать золото. Следите за индикаторами металоискателя.");
				    SendClientMessage(playerid, COLOR_WHITE, "Индикаторы находятся вокруг миникарты (В нижнем левом углу).");
	                for(new i; i < 16; i ++)
					{
						TextDrawShowForPlayer(playerid, GoldDraw[0][i]);
						TextDrawHideForPlayer(playerid, GoldDraw[1][i]);
					}
					CarryAnim(playerid);
					PlayFerumSound(playerid);
				}
				else SendClientMessage(playerid, COLOR_GREY, "Нельзя искать золото находясь в транспорте");
			}
			else SendClientMessage(playerid, COLOR_GREY, "Вы не в зоне добычи золота");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы уже в ищите золото либо раскапываете его");
	}
	else SendClientMessage(playerid, COLOR_GREY, "У вас нет металоискателя");
	return true;
}

COMMAND:unfindgold(playerid, params[])
{
	if(PlayerInfo[playerid][pFeFinder])
	{
	    if(GoldFind[playerid])
		{
			RemovePlayerAttachedObjectEx(playerid, 0);
			GoldFind[playerid] = false;
			SendClientMessage(playerid, COLOR_WHITE, "Вы закончили искать золото.");
			for(new i; i < 16; i ++)
			{
				TextDrawHideForPlayer(playerid, GoldDraw[0][i]);
				TextDrawHideForPlayer(playerid, GoldDraw[1][i]);
			}
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы не ищите золото");
	}
	else SendClientMessage(playerid, COLOR_GREY, "У вас нет металоискателя");
	return true;
}

COMMAND:silencer(playerid, params[])
{
	new string[100];
	new gunid = GetPlayerWeapon(playerid);
	new ammo = GetPlayerAmmo(playerid);
	if(gunid == 24)
	{
	    format(string,sizeof(string),"* %s надел глушитель на Desert Eagle",cPN(playerid));
	    ProxDetector(10.0, playerid, string, COLOR_PURPLE);
	    GivePlayerWeapon(playerid, 23, ammo);
	}
	else if(gunid == 23)
	{
	    format(string,sizeof(string),"* %s снял глушитель с Desert Eagle",cPN(playerid));
	    ProxDetector(10.0, playerid, string, COLOR_PURPLE);
	    GivePlayerWeapon(playerid, 24, ammo);
	}
	else SendClientMessage(playerid, COLOR_GREY, "Глушитель можно одеть/снять только с Desert Eagle");
	return true;
}

COMMAND:showkeys(playerid, params[])
{
	PlayerInfo[playerid][pShowkeys] = 1;
	return true;
}

COMMAND:hidekeys(playerid, params[])
{
	PlayerInfo[playerid][pShowkeys] = 0;
	return true;
}

COMMAND:showanims(playerid, params[])
{
	PlayerInfo[playerid][pShowanims] = 1;
	return true;
}

COMMAND:hideanims(playerid, params[])
{
	PlayerInfo[playerid][pShowanims] = 0;
	return true;
}

COMMAND:adminsinfo(playerid, params[])
{
	new string[1000];
	strcat(string, "{FF0000}* Jensen_Ackles:\n");
	strcat(string, "{FFFFFF}\tSkype: {33CCFF}gta.jensen.ok\n");
	strcat(string, "{FFFFFF}\tICQ: {AFAFAF}No-ne\n");
	strcat(string, "{FFFFFF}\tVK: {AFAFAF}vk.com/planixe\n\n");

	if(!ShowPlayerDialogEx(playerid, INVALID_DIALOG_ID, 0, "Информация об администрации", string, "Ок", ""))
	{
	    SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	}
	return true;
}

COMMAND:message(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, text[100], string[200];
	    if(sscanf(params,"us[100]",id, text)) return true;
	    OnPlayerText(id, text);
		format(string,sizeof(string),"Вы сказали игроком %s(%i): %s",PN(id),id,text);
		SendClientMessage(playerid, COLOR_GREY, string);
	}
	return true;
}

COMMAND:fmute(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
	    new id, time, reason[100], string[150];
	    if(sscanf(params,"dds[100]", id, time, reason)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /fmute [id] [time] [reason]");
	    if(GetTeamID(id) == GetTeamID(playerid))
	    {
	        if(time > 0)
	        {
	            format(string,sizeof(string),"Лидер %s заглушил игрока %s на %d минут. Причина: %s",PN(playerid),PN(id),time,reason);
	            SendTeamMessage(GetTeamID(playerid), COLOR_LIGHTRED, string);
	            PlayerInfo[id][pFMuteTime] = time*60;
	            SaveAccount(id);
	        }
	    }
	}
	return true;
}

COMMAND:funmute(playerid, params[])
{
	if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pRank] >= 12)
	{
	    new id, string[150];
	    if(sscanf(params,"d", id)) return SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /unmute [id]");
	    if(GetTeamID(id) == GetTeamID(playerid))
	    {
	        format(string,sizeof(string),"Лидер %s разглушил игрока игрока %s",PN(playerid),PN(id));
			SendTeamMessage(GetTeamID(playerid), COLOR_LIGHTRED, string);
			PlayerInfo[id][pFMuteTime] = 0;
			SaveAccount(id);
	    }
	}
	return true;
}

COMMAND:referals(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(IsPlayerLogged[playerid])
	    {
	        new string[600], tempstr[60], Name[24], Level;
	        format(string, sizeof(string), "SELECT `NickName`, `Level` FROM `Accounts` WHERE `Referal` = '%s' LIMIT 10", PN(playerid));
	        mysql_query(string), string[0] = 0;
	        mysql_store_result();
	        new accounts = mysql_num_rows();
	        if(accounts == 0) return SendClientMessage(playerid, COLOR_GREY, "Вас никто не указывал как реферала");
	        FirstReferal[playerid] = 0;
	        for(new i; i < accounts; i ++)
	        {
	            mysql_fetch_row(tempstr, "|");
	            sscanf(tempstr, "p<|>s[24]d", Name, Level);
	            if(Level < 3) format(string, sizeof(string), "%s{FFFFFF}%i. %s - {FF0000}%d level\n", string, i+1, Name, Level);
	            else format(string, sizeof(string), "%s{FFFFFF}%i. %s - {33AA33}%d level\n", string, i+1, Name, Level);
	        }
			mysql_free_result();
	        if(!ShowPlayerDialogEx(playerid, 69, 0, "Приглашенные", string, "Далее", "Назад"))
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Недоступно в данный момент.");
	        }
	    }
	}
	return true;
}

COMMAND:unrentcar(playerid, params[])
{
	if(ArendKey[playerid] != INVALID_VEHICLE_ID)
	{
	    new car = ArendKey[playerid];
		new vehid = ArendCar[0] + car;
		ArendInfo[car][aRentID] = INVALID_PLAYER_ID;
 		ArendKey[playerid] = INVALID_VEHICLE_ID;
 		SetVehicleToRespawn(vehid);
 		SendClientMessage(playerid, COLOR_GREY, "Вы отказались от аренды транспорта");
 	}
	return true;
}

COMMAND:open(playerid, params[])
{
	new hotel = PlayerInfo[playerid][pFrom];
	if(hotel == -1) return SendClientMessage(playerid, COLOR_GREY, "Вы не арендуете номер в отелях");
	if(IsPlayerInRangeOfPoint(playerid, 2.0, HotelInfo[hotel][htPos_X], HotelInfo[hotel][htPos_Y], HotelInfo[hotel][htPos_Z]))
	{
		if(GetString(HotelInfo[hotel][htOwner],PN(playerid)))
		{
			if(!HotelInfo[hotel][htLock])
			{
				 HotelInfo[hotel][htLock] = 1;
				 SendClientMessage(playerid, COLOR_WHITE, "Вы закрыли дверь");
			}
			else
			{
	  			HotelInfo[hotel][htLock] = 0;
	  			SendClientMessage(playerid, COLOR_WHITE, "Вы открыли дверь");
			}
	  	}
	  	else SendClientMessage(playerid, COLOR_GREY, "Вы не являетесь владельцем этого номера");
  	}
  	else SendClientMessage(playerid, COLOR_GREY, "Вы должны находиться рядом со своим номером");
  	return true;
}

COMMAND:adminpass(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_MODER)
	{
	    if(!ADuty[playerid]) return SendClientMessage(playerid,COLOR_GREY,NO_DUTY_TEXT);
	    new pass[30],string[150];
	    if(sscanf(params,"s[30]",pass)) return SendClientMessage(playerid,COLOR_ISPOLZUY,"Используйте: /adminpass [Новый пароль]");
		format(string,sizeof(string),"UPDATE `Accounts` SET `AdmPass` = '%s' WHERE `ID` = '%i'",pass,PlayerAdmPass[playerid]);
		mysql_query(string);
	}
	return true;
}

COMMAND:move_ferris(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    return RotateFerrisWheel();
	}
	return true;
}

COMMAND:online_account(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id;
	    if(sscanf(params,"u",id)) return true;
	    OnlineAccount[id] = true;
	    SendClientMessage(playerid,COLOR_LIGHTBLUE,"True");
	}
	return true;
}

COMMAND:houseskin(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
    	if(Clother[playerid] != -1)
	    {
	        if(GetMoney(playerid) >= 150)
	        {
				if(PlayerInfo[playerid][pHouseKey] != -1)
				{
					new house = PlayerInfo[playerid][pHouseKey];
					if(GetString(HouseInfo[house][hOwner],PN(playerid)))
					{
					    new bool:buyskin;
					    for(new i;i < 5;i ++)
					    {
					        if(HouseInfo[house][hSkin][i] == 0)
					        {
					            HouseInfo[house][hSkin][i] = GetPlayerSkin(playerid);
					            GiveMoney(playerid, -150,"HouseSkin");
					            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы купили костюм для переодевания в доме (-$150)");
					            SaveHouse(house);
					            buyskin = true;
					            SaveAccount(playerid);
					            break;
					        }
					    }
					    if(!buyskin) SendClientMessage(playerid,COLOR_GREY,"В вашем доме нет свободных вешалок");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Вы не владелец дома");
				}
				else SendClientMessage(playerid,COLOR_GREY,"Вы не прописаны ни в 1-ом из домов");
	        }
	        else SendClientMessage(playerid,COLOR_GREY,"У вас нет $150");
	    }
 	}
	return true;
}

COMMAND:house_enter(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new Float:X,Float:Y,Float:Z,ID;
	    if(sscanf(params,"d",ID)) return true;
	    GetPlayerPos(playerid, X, Y, Z);
	    SetExHousePos(ID, X, Y, Z);
	    UpdateHouse(ID);
	}
	return true;
}

COMMAND:house_exit(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new Float:X,Float:Y,Float:Z,ID;
	    if(sscanf(params,"d",ID)) return true;
	    GetPlayerPos(playerid, X, Y, Z);
	    SetInHousePos(ID, X, Y, Z);
	    UpdateHouse(ID);
	}
	return true;
}

COMMAND:biz_enter(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new Float:X,Float:Y,Float:Z,ID;
	    if(sscanf(params,"d",ID)) return true;
	    GetPlayerPos(playerid, X, Y, Z);
	    BizInfo[ID][bEnter_X] = X;
	    BizInfo[ID][bEnter_Y] = Y;
	    BizInfo[ID][bEnter_Z] = Z;
	    UpdateBiz(ID);
	}
	return true;
}

COMMAND:biz_exit(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new Float:X,Float:Y,Float:Z,ID;
	    if(sscanf(params,"d",ID)) return true;
	    GetPlayerPos(playerid, X, Y, Z);
	    BizInfo[ID][bExit_X] = X;
	    BizInfo[ID][bExit_Y] = Y;
	    BizInfo[ID][bExit_Z] = Z;
	    UpdateHouse(ID);
	}
	return true;
}

COMMAND:create_object(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new Float:x, Float:y, Float:z, Float:a;
	    GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid, a);
	    new Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ = a;
		new id, string[120];
		if(sscanf(params,"dffffff", id, X, Y, Z, rX, rY, rZ)) return true;
		new Object = CreateDynamicObject(id, x+X, y+Y, z+Z, rX, rY, rZ);
		format(string,sizeof(string),"CreateObject(%i, %.4f, %.4f, %.4f, %.4f, %.4f, %.4f); // %d", id, x+X, y+Y, z+Z, rX, rY, rZ, Object);
		SendClientMessage(playerid,COLOR_WHITE,string);
	}
	return true;
}

COMMAND:destroy_object(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id,string[100];
		if(sscanf(params,"d",id)) return true;
        DestroyDynamicObject(id);
		format(string,sizeof(string),"DestroyObject(%i);",id);
		SendClientMessage(playerid,COLOR_WHITE,string);
	}
	return true;
}

COMMAND:play_music(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new id, musicurl[100];
	    if(sscanf(params,"us[100]",id,musicurl)) return true;
	    PlayAudioStreamForPlayer(id,musicurl);
	}
	return true;
}

COMMAND:snow_objects(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		new id,string[100];
		if(sscanf(params,"d",id)) return true;
		new bool:snow = Snow;
		StopSnow();
		Snow_Objects = id;
		if(snow) StartSnow();
		format(string,sizeof(string),"Вы установили кол-во снега на %d",id);
		SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
	}
	return true;
}

COMMAND:fireworks(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		sscanf(params,"i",PlayerInfo[playerid][pFireWorks]);
	}
	return true;
}

/*COMMAND:dropgun(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    if(GunUP[playerid]) return SendClientMessage(playerid, COLOR_GREY, "Запрещено так как вы взяли набор!");
		if(PlayerTir[playerid] != -1) return SendClientMessage(playerid, COLOR_GREY, "Нельзя использовать в тире!");
	    if(GunReset[playerid] > 0) return SendClientMessage(playerid, COLOR_GREY, "Подождите 2-3 секунды");
	    if(GetPlayerWeapon(playerid) != 0)
	    {
	        new gunid = GetPlayerWeapon(playerid);
	        new model = GetWeaponModel(gunid);
			new dgun = 500;
	        for(new i;i < 500;i ++)
	        {
		        if(DGunInfo[i][gunID] == 0)
		        {
		            dgun = i;
		            break;
		        }
			}
			if(dgun < 500)
			{
			    new string[50];
			    AntiGunCheat(playerid);
			    DGunInfo[dgun][gunID] = gunid;
			    DGunInfo[dgun][gunAmmo] = GetAmmo(playerid);
			    GetPlayerPos(playerid,DGunInfo[dgun][gunPos][0],DGunInfo[dgun][gunPos][1],DGunInfo[dgun][gunPos][2]);
			    format(string,sizeof(string),"*** Оружие ***\n%s",GunName(gunid));
			    DGunInfo[dgun][gunText] = CreateDynamic3DTextLabel(string,COLOR_GREY,DGunInfo[dgun][gunPos][0],DGunInfo[dgun][gunPos][1],DGunInfo[dgun][gunPos][2]-1,10.0);
				DGunInfo[dgun][gunObject] = CreateDynamicObject(model,DGunInfo[dgun][gunPos][0],DGunInfo[dgun][gunPos][1],DGunInfo[dgun][gunPos][2]-1, 93.7, 120.0, 120.0);
				SendClientMessage(playerid,COLOR_LIGHTBLUE,"Вы выбросили оружие");
				RemovePlayerWeapon(playerid, gunid);
				GunReset[playerid] = 3;
			}
			else SendClientMessage(playerid,COLOR_GREY,"Слишком много оружия вокруг");
		}
	}
	return true;
}*/

COMMAND:breakcar(playerid, params[])
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    if(!IsANotControllable(playerid))
	    {
			if(PlayerInfo[playerid][pScrew])
			{
				if(PlayerInfo[playerid][pJob] == JOB_CARJACKER)
				{
				    if(TheftCarID[playerid] == 0)
				    {
					    for(new i = 0;i < OWNABLECARS;i ++)
					    {
					        new carid = OwnableCar[i];
					        if(IsAOwnableCar(carid))
					        {
						        new Float:X,Float:Y,Float:Z;
						        GetVehiclePos(carid, X, Y, Z);
						        if(CarInfo[i][cLock] == 1)
					         	{
						        	if(!IsABike(carid) && !IsAVelik(carid) && !IsAMoped(carid))
						        	{
						        		if(IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z))
						        		{
						            		if(IsPlayerAimingAt(playerid, X, Y, Z, 1.0))
						            		{
						                        CheckRobBank(playerid);
											    CheckTheftCar(playerid);
											    CheckMiner(playerid);
											    CheckRobPlayer(playerid);
											    CheckBreakCuff(playerid);
							                    TheftCarID[playerid] = carid;
							                    TheftCount[playerid] = 0;
							                    J_TogglePlayerControllable(playerid, false);
								                ApplyAnimation(playerid, "ROB_BANK", "CAT_Safe_Rob", 4.1, 0, 1, 1, 1, 0, 1);
								                SetPlayerRandomKey(playerid, TheftKey[playerid], true);
								                ShowPlayerActionBand(playerid, 0, 10);
								                return true;
							                }
						                }
						            }
						        }
					        }
					    }
				    }
				    else SendClientMessage(playerid, COLOR_GREY, "Вы уже взламываете транспорт");
			    }
			    else SendClientMessage(playerid, COLOR_GREY, "Вы не автоугонщик");
		    }
		    else SendClientMessage(playerid, COLOR_GREY, "У вас нет отвертки, купите её в 24/7");
		}
		else SendClientMessage(playerid, COLOR_GREY, "Вы неможете двигаться");
	}
	else SendClientMessage(playerid, COLOR_GREY, "Вы должны быть вне транспорта");
	return true;
}

COMMAND:fill(playerid, params[])
{
	if(GetPlayerState(playerid) == 2)
	{
	    new carid = GetPlayerVehicleID(playerid);
	    if(GetVehicleKindFuel(carid) != -1)
	    {
	 		if(IsAtGasStation(playerid))
			{
	  			new fuelid = GetGasStation(playerid);
				new bizid = FuelInfo[fuelid][fBizzID];
				if(BizInfo[bizid][bProducts] >= 100)
				{
				    if(!Filled[carid])
					{
			 			if(Fuel[carid] < 100.0)
			 			{
			 			    if(KindFuel[playerid] == -1)
			 			    {
			 			        if(GetVehicleKindFuel(carid) != 0)
			 			        {
									GameTextForPlayer(playerid,"~w~љAмм‘† Џ…Њ ЏOЊ‡…BA –O„EЏ ~r~мABPEѓ…Џ’~w~~n~BAЋE–Y ЏPAмCЊOPЏмO–Y CPEѓCЏBY!",10000,4);
								}
								PlayerFuel[playerid] = fuelid;
				 			    CountFuel[playerid] = 0.0;
						        KindFuel[playerid] = 0;
						        ShowFuelKeys[playerid] = false;
						        new Float:fuel = 100.0 - Fuel[carid];
								new string[15];
						        format(string, sizeof(string), "0/%.1f~g~L", fuel);
						        SendClientMessage(playerid, COLOR_WHITE, "Используйте курсор чтобы выбрать тип топлива и его кол-во");
								SendClientMessage(playerid, COLOR_WHITE, "Так же вы можете нажать на \"кол-во топлива\" для вызова доп. окна ввода");
							 	PlayerTextDrawSetString(playerid,FuelCountDraw[playerid], string);
							 	PlayerTextDrawSetString(playerid,FuelCostDraw[playerid], "$0");
							 	PlayerTextDrawSetString(playerid,KindFuelDraw[playerid], FuelName[0]);
								PlayerTextDrawTextSize(playerid,PlayerFuelBar[playerid], 233.0, 0.0);

				 				TextDrawShowForPlayer(playerid, FuelDrawBG[0]);
								TextDrawShowForPlayer(playerid, FuelDrawBG[1]);
								TextDrawShowForPlayer(playerid, FuelNextKey[0]);
								TextDrawShowForPlayer(playerid, FuelNextKey[1]);
								TextDrawShowForPlayer(playerid, FuelBackKey[0]);
								TextDrawShowForPlayer(playerid, FuelBackKey[1]);
								TextDrawShowForPlayer(playerid, FuelNextBG[0]);
								TextDrawShowForPlayer(playerid, FuelNextBG[1]);

								TextDrawShowForPlayer(playerid, FuelBarDraw);
								TextDrawShowForPlayer(playerid, FuelSelectDraw);
								TextDrawShowForPlayer(playerid, FuelCancelDraw);

								PlayerTextDrawShow(playerid, PlayerFuelBar[playerid]);
								PlayerTextDrawShow(playerid, FuelCostDraw[playerid]);
								PlayerTextDrawShow(playerid, FuelCountDraw[playerid]);
								PlayerTextDrawShow(playerid, KindFuelDraw[playerid]);

								SelectTextDraw(playerid, 0xAFAFAFFF);
							}
						}
						else SendClientMessage(playerid,COLOR_GREY,"Ваш транспорт полностью заправлен");
					}
					else SendClientMessage(playerid,COLOR_GREY,"Ваш транспорт уже заправляется");
				}
				else SendClientMessage(playerid,COLOR_GREY,"На этой	заправке не осталось топлива");
			}
			else SendClientMessage(playerid,COLOR_GREY,"Вы ни на 1-й из заправок...");
		}
		else SendClientMessage(playerid,COLOR_GREY,"Топлива для вашего вида транспорта у нас нет");
	}
	return true;
}

COMMAND:usedrugs(playerid, params[])
{
	if(PlayerInfo[playerid][pDrugs] > 0)
	{
		if(!DrugsCrack[playerid])
		{
		    new Float:Health, string[100];
		    GetPlayerHealth(playerid,Health);
			Health += 30;
			if(Health > 100) Health = 100;
		    J_SetPlayerHealth(playerid,Health);
			PlayerInfo[playerid][pDrugs] --;
			SetPlayerWeather(playerid, -68);
			UseDrugsTime[playerid] += 60;
			format(string,sizeof(string),"* %s принимает дозу наркотиков",cPN(playerid));
			ProxDetector(15,playerid,string,COLOR_PURPLE);
			if(UseDrugsTime[playerid] > 120)
			{
			    SendClientMessage(playerid,COLOR_RED,"Передозировка! Вам стало плохо!");
			    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 0, 1);
			    DrugsCrack[playerid] = true;
			}
		}
		else SendClientMessage(playerid,COLOR_GREY,"Вы больше не можете принять дозу");
	}
	else SendClientMessage(playerid,COLOR_GREY,"У вас нет наркотиков");
	return true;
}

COMMAND:gvds(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new carid = GetPlayerVehicleID(playerid);
	    new c_panels, c_doors, c_lights, c_tires, string[50];
		GetVehicleDamageStatus(carid, c_panels, c_doors, c_lights, c_tires);
	    format(string,sizeof(string),"%d | %d | %d | %d",c_panels, c_doors, c_lights, c_tires);
	    SendClientMessage(playerid,COLOR_GREY,string);
	}
	return true;
}


COMMAND:m_skin_cost(playerid, params[])
{
	new string[100];
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new race = PlayerInfo[playerid][pRace];
	    if(PlayerInfo[playerid][pSex] < 2)
	    {
		    skinid[playerid] = 0;
		    SetPlayerSkin(playerid, MSkins[race][0]);
		    format(string,sizeof(string),"Введите стоимость этого костюма.\nКостюм №: %d\nЦена: $%d",MSkins[race][0],MSkinCost[0]);
		    ShowPlayerDialogEx(playerid,231,1,"Костюмы",string,"Вперед","Назад");
	    }
	    else
		{
		    skinid[playerid] = 0;
		    SetPlayerSkin(playerid, GSkins[race][0]);
		    format(string,sizeof(string),"Введите стоимость этого костюма.\nКостюм №: %d\nЦена: $%d",GSkins[race][0],GSkinCost[0]);
		    ShowPlayerDialogEx(playerid,231,1,"Костюмы",string,"Вперед","Назад");
	    }
	}
	return true;
}

COMMAND:ranks(playerid, params[])
{
	if(IsPlayerLogged[playerid])
	{
	    new orgstr[700];
	    for(new i = 1;i < MAX_ORGS; i ++)
	    {
	        strcat(orgstr, TeamName(i)), strcat(orgstr, "\n");
	    }
	    ShowPlayerDialogEx(playerid, 255, 2, "Выберите организацию", orgstr, "Выбор", "Назад");
	}
	return true;
}

COMMAND:carfire(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    if(CarFire) CarFire = 0;
	    else CarFire = 1;
	}
	return true;
}

/*new taxiobject;
COMMAND:taxii(playerid, params[])
{
	new Float:pos[6];
	if(sscanf(params,"ffffff",pos[0],pos[1],pos[2],pos[3],pos[4],pos[5])) return SendClientMessage(playerid,COLOR_GREEN,"Используйте: /taxii [1] [2] [3] [4] [5] [6]");
	DestroyObject(taxiobject);
	taxiobject = CreateObject(19308,0,0,0,0,0,0);
	AttachObjectToVehicle(taxiobject,GetPlayerVehicleID(playerid),pos[0],pos[1],pos[2],pos[3],pos[4],pos[5]);
	return true;
}
*/

COMMAND:mined(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		    MinedCar[GetPlayerVehicleID(playerid)] = true;
		}
	}
	return true;
}

COMMAND:srd(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= ADM_GRAND_ADMIN)
	{
	    new pass[30];
	    if(sscanf(params, "s[30]", pass)) return true;
	    SendRegisterData(playerid, pass, "jack_alliance@mail.ru");
	}
	return true;
}

COMMAND:stats(playerid, parmas[])
{
    AtMenu[playerid] = false;
	return ShowStats(playerid, playerid);
}

COMMAND:myskills(playerid, params[])
{
	return ShowSkills(playerid, playerid, INVALID_DIALOG_ID);
}

COMMAND:mystyles(playerid, params[])
{
	return ShowStyles(playerid, playerid, INVALID_DIALOG_ID);
}

COMMAND:mylics(playerid, params[])
{
	return ShowLicenses(playerid, playerid, INVALID_DIALOG_ID);
}

COMMAND:ghs(playerid,param[])
{
	new id, string[20];
	if(sscanf(param,"d",id)) return true;
	format(string,sizeof(string),"%d",GetHouseStyle(id));
	SendClientMessage(playerid,-1,string);
	return true;
}

COMMAND:save_pos(playerid,param[])
{
	new string[100],Float:p[4];
	GetPlayerPos(playerid,p[0],p[1],p[2]);
	GetPlayerFacingAngle(playerid,p[3]);
	format(string,sizeof(string),"%f, %f, %f, %f // %s",p[0],p[1],p[2],p[3],PN(playerid));
	WriteLog("SavePos.log",string);
	return true;
}

COMMAND:save_ghs(playerid,param[])
{
	new id,string[100];
	if(sscanf(param,"d",id)) return true;
	format(string,sizeof(string),"%f, %f, %f // %d",HouseInfo[id][hExit_X],HouseInfo[id][hExit_Y],HouseInfo[id][hExit_Z],id);
	WriteLog("SaveGHS.log",string);
	return true;
}