//A-Code - 1 - FlyHack
//A-Code - 2 - Уничтожение автомобилей чит. способом
//A-Code - 3 - Anti-Weapon crasher
//A-Code - 4 - Bad Gun
//A-Code - 5 - HIGH PING
//A-Code - 6 - AIM (joypad)
//A-Code - 7 - WeaponHack PRO
//A-Code - 8 - Special Action

#include <a_samp>
#include <a_mysql>
#include <sscanf2>
#include <DC_CMD>
#include <regex>
#include <foreach>
#include <mxdate>

#define dg_dmGun 13
#define dg_dmGun2 14
#define dg_dmGun3 15

#define MAX_IP 3
//---------[DataBase]
#define mysql_host     			"localhost"
#define mysql_user     			"root"
#define mysql_db 				"skyworld"
#define mysql_pass 				""
#define Baza           			"accountss"
//---------[DataBase]

#define PlayerName(%0)      	PlayerInfo[%0][pName]
#define QueryEmpty(%0,%1) \
mysql_function_query(%0, %1, true, "Empty", "")
#define Dialog      			ShowPlayerDialog
#define MAX_AIM_TICKS 			3
#define MAX_STRING 				512
#define DIALOGUNBAN 			899
#define SendMe(%0,%2,%1) 		SendClientMessage(%0, %2,%1)
#define COLOR_LIGHT_BLUE 		0xFFC801C8
#define COLOR_BOX 				0x00000050
#define COLOR_1 				0xFFFF00AA
#define COLOR_LIME 				0xB7FF00AA
#define COLOR_BBLUE 			0x20A9FFFF
#define COLOR_CLUB 				0x00AFF6AA
#define COLOR_ISPOLZUY 			0x7FB151FF
#define COLOR_GRAD1 			0xB4B5B7FF
#define COLOR_RD 				0xF81414FF
#define COLOR_SINIY 			0x00004FAA
#define COLOR_LG 				0x7FFF00FF
#define COLOR_BLUE 				0x33AAFFFF
#define COLOR_SALMON 			0xFA8072AA
#define COLOR_SYSTEM 			0xEFEFF7AA
#define COLOR_KHAKI 			0xF0E68CAA
#define COLOR_TEAL 				0x008080FF
#define COLOR_GRAD2 			0xBFC0C2FF
#define COLOR_INDIGO 			0x4B00B0AA
#define COLOR_IVORY 			0xFFFF82AA
#define COLOR_TEAL 				0x008080FF
#define COLOR_GRAD3 			0xCBCCCEFF
#define COLOR_GRAD4 			0xD8D8D8FF
#define COLOR_GRAD5 			0xE3E3E3FF
#define COLOR_GRAD6 			0xF0F0F0FF
#define COLOR_YELLOW 			0xFFFF00AA
#define COLOR_GRAD7 			0xF0F0F0FF
#define COLOR_GRAD8 			0xF0F0F0FF
#define COLOR_BLACK 			0x000000AA
#define COLOR_GREY 				0xAFAFAFAA
#define COLOR_BLUEGREEN 		0x46BBAA00
#define COLOR_RED 				0xAA3333AA
#define COLOR_LIGHTRED 			0xFF6347AA
#define COLOR_LIGHTBLUE 		0x33CCFFAA
#define COLOR_LIGHTGREEN 		0x9ACD32AA
#define COLOR_YELLOW2 			0xF5DEB3AA
#define COLOR_WHITE 			0xFFFFFFAA
#define COLOR_REDD 				0xFF0000AA
#define COLOR_BROW 				0xA85400AA
#define COLOR_FADE1 			0xE6E6E6E6
#define COLOR_FADE2 			0xC8C8C8C8
#define COLOR_FADE3 			0xAAAAAAAA
#define COLOR_FADE4 			0x8C8C8C8C
#define COLOR_FADE5 			0x6E6E6E6E
#define COLOR_PURPLE 			0xC2A2DAAA
#define COLOR_DBLUE 			0x2641FEAA
#define COLOR_ALLDEPT 			0xFF8282AA
#define COLOR_LIFE 				0xFEBC41AA
#define TEAM_HIT_COLOR 			0xFFFFFF00
#define TEAM_BLUE_COLOR 		0x8D8DFF00
#define COLOR_ADD 				0x63FF60AA
#define TEAM_GROVE_COLOR 		0x00D900C8
#define TEAM_VAGOS_COLOR 		0xFFC801C8
#define TEAM_BALLAS_COLOR 		0xD900D3C8
#define TEAM_AZTECAS_COLOR 		0x01FCFFC8
#define TEAM_CYAN_COLOR 		0xFF8282AA
#define TEAM_ORANGE_COLOR 		0xFF830000
#define COLOR_INVIS 			0xAFAFAF00
#define COLOR_SPEC 				0xBFC0C200
#define COLOR_STROKA 			0xFD0A9FF

#define Kick.(%0) SetTimerEx("OnPlayerKick",100,false,"i",%0)
#define MAX_CLASSES     300
#define GivePlayerWeapon FP_GivePlayerWeapon
#define ResetPlayerWeapons FP_ResetPlayerWeapons
#define AddPlayerClass FP_AddPlayerClass
#define AddPlayerClassEx FP_AddPlayerClassEx
#define SetSpawnInfo FP_SetSpawnInfo

#define Message     			SendClientMessage
#define IsKicked(%0) GetPVarInt(%0, "kicked")

#define NULL 0
#define function%0(%1) forward%0(%1); public%0(%1)

#define MAX_AFK_TIME 600
#define AFK_TEXT_SET 2
#define T_DIST 20.0
#define f(%1,               format(%1,sizeof(%1),

#define SetPlayerSpecialAction FP_SetPlayerSpecialAction
#define fpub:%0(%1) forward %0(%1); public %0(%1)
#define GetName(%1) pPlayerName[%1]

stock Name(i) { new pl[24]; GetPlayerName(i, pl, 24); return pl; }
stock GetIp(i){new s[54]; GetPlayerIp(i, s, 16);return s;}

forward DelayedKick(playerid);
public DelayedKick(playerid) return Kick(playerid);

forward Fresh();
forward UpdateJailZone();
forward OnPlayerKick(playerid);

forward PlayerKick(playerid);
public PlayerKick(playerid)
{
	Kick(playerid);
}

new gapDm1,gapDm2,gapDm3;

//Античит на оружие
new FP_Classid_APC;
new FP_Classid_APCE;
new FP_Weapon[MAX_PLAYERS][47];
new FP_Get_Weap[MAX_PLAYERS];
new FP_Ammo_Weapon_i[MAX_PLAYERS];
new FP_Weap_Spawn_Pro[MAX_PLAYERS];
new FP_Spawn_Weapons[MAX_PLAYERS][3];
new FP_Player_Class_Weapons[MAX_CLASSES][3];
new FP_Spawn_Weapons_i[MAX_PLAYERS];
//Античит на оружие конец

new Float:DM1[25][3] = {
	{-397.6272,2197.1924,42.4256},//1
	{-384.7242,2208.7585,42.4241},//2
	{-394.5153,2214.4500,42.4255},//3
	{-391.8152,2232.9954,42.4297},//4
	{-366.7237,2239.1770,42.4844},//5
	{-351.9104,2242.4006,42.4844},//6
	{-348.2275,2221.9250,42.4912},//7
	{-358.0328,2205.4819,42.4844},//8
	{-370.1264,2249.9778,42.4844},//9
	{-367.9854,2266.9844,42.4183},//10
	{-378.6484,2261.1135,42.4844},//11
	{-397.3462,2251.1626,42.4297},//12
	{-411.1055,2260.2249,42.4297},//13
	{-419.6152,2244.9631,42.4297},//14
	{-406.6959,2243.2339,42.4297},//15
	{-399.5045,2230.8550,42.4297},//16
	{-414.3124,2229.7471,42.4258},//17
	{-421.0251,2225.3208,42.4297},//18
	{-436.6256,2240.7229,42.4297},//19
	{-428.9543,2252.3757,42.4297},//20
	{-457.0149,2227.4109,43.0427},//21
	{-453.5172,2218.5017,42.4539},//22
	{-443.9604,2220.2961,42.4297},//23
	{-435.5698,2226.3645,42.4297},//24
	{-415.5969,2221.9404,42.4297}//25
};

new Float:DM2[11][3] = {
	{2086.2957,-1233.0795,25.4850},
	{2095.3362,-1341.7936,23.9844},
	{2053.7571,-1296.3673,23.9841},
	{2020.7057,-1305.5107,20.8744},
	{2034.0520,-1323.5447,23.1794},
	{2153.9209,-1256.2985,24.9926},
	{2258.7708,-1272.3206,25.3594},
	{2145.3723,-1270.7748,23.9947},
	{2118.0623,-1242.3286,25.4827},
	{2096.9561,-1280.4242,25.4978},
	{2122.8462,-1279.6970,25.4987}
};

new Float:DM3[10][3] = {
	{-195.2702,2775.2422,61.8321},
	{-163.2157,2701.1504,62.3515},
	{-318.5495,2722.2244,62.6875},
	{-220.2558,2773.3625,62.6875},
	{-277.3810,2735.4644,62.3874},
	{-267.8980,2761.5313,62.0757},
	{-152.7532,2763.6760,62.5832},
	{-228.0060,2817.1819,62.2687},
	{-318.5495,2722.2244,62.6875},
	{-294.7887,2755.6326,61.8833}
};

new RegEx:reklamka;

new MYSQL_ARG;
new asd[2000];
new client[2000];
new admpass = 117405;
new admloged[MAX_PLAYERS];
new Float:GMHP[MAX_PLAYERS][2];
new Float:VEHHP[MAX_PLAYERS][2];
new Float:GMARMOUR[MAX_PLAYERS][1];
new SpecAd[MAX_PLAYERS];
new player_NoCheckTimeVeh[MAX_PLAYERS];
new gVehicleDriver[MAX_VEHICLES];
new createdvehs;
new createdvehicles[MAX_PLAYERS];
new CreatedCars[100];
new CreatedCar = 0;

new FP_Actionid_Player[MAX_PLAYERS];
new FP_Special_Action[MAX_PLAYERS];
new FP_Special_Action_Death[MAX_PLAYERS];

new querybans[200];
new pPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];

new Float:coord[MAX_PLAYERS];
new Text:LoadingText[MAX_PLAYERS][4];

enum afk_info
{
	AFK_Time,
	Float:AFK_Coord,
	AFK_Stat
}

enum Info
{
    pName[24],
    pPassword[15],
	pAdmin,
	pKills,
	pDeaths,
	pLogged,
	IP,
	pJailed,
	pJailTime
}
new PlayerInfo[MAX_PLAYERS][Info];

new PlayerAFK[MAX_PLAYERS][afk_info];
new Text3D:AFK_3DT[MAX_PLAYERS];
new AFK_Timer;

new sTimer[1];

new Text:Textdraw0;
new Text:Textdraw1;
new god[MAX_PLAYERS];
new AFK[MAX_PLAYERS];
new Text:StartSkin[MAX_PLAYERS][5];
new bool:skin[MAX_PLAYERS];
new SkinPed[MAX_PLAYERS];
new Skinn[84] = { 6,7,19,21,11,12,23,24,28,29,30,46,47,55,56,60,66,67,76,86,90,91,93,98,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,134,141,144,149,150,169,170,171,172,173,174,175,177,179,180,186,191,192,195,221,223,230,241,250,269,270,171,272,273,292,293,294,296,299 };
new Float:RandomSpawns[][] =
{
    {1682.7261,-2303.3679,13.5330,177.5915},
    {1682.2155,-2312.5769,13.5469,0.8932},
    {1680.3167,-2307.9827,13.5398,266.5790},
    {1686.1143,-2308.1169,13.5400,103.6441},
    {1684.6573,-2314.5176,13.3828,318.8828}
};

forward AFKCheck();

main()
{
	print("-----------------------[Skyworld Test Server]-----------------------");
	print("----------------------[Mode Loading Sucessful]----------------------");
	print("---------------------------[|Loaded 100%|---------------------------");
}

public OnGameModeInit()
{
    MYSQL_ARG = mysql_connect(mysql_host, mysql_user, mysql_db, mysql_pass);//Подключаем(плагин) к серверу
	SetGameModeText("DeathMatch | SkyWorld");
    DisableInteriorEnterExits();
	EnableStuntBonusForAll(0);
	mysql_debug(1);
	new stats[100];
	mysql_stat(stats);
	print(stats);

	load_obj();
	CreateTimers();
	
	SetTimer("UpdateJailZone",3000,1);
	
	for(new i = 0; i < sizeof(CreatedCars); i++){CreatedCars[i] = 0;}
	
	AFK_Timer = SetTimer("AFKCheck",1000,1);
	
	for(new z;z<MAX_VEHICLES;z++)
	{
		gVehicleDriver[z] = INVALID_PLAYER_ID;
	}
	for(new i = 0; i < MAX_PLAYERS; i++)
 	{
 	    LoadingText[i][0] = TextDrawCreate(641.531494, 1.500000, "usebox");
		TextDrawLetterSize(LoadingText[i][0], 0.000000, 49.396297);
		TextDrawTextSize(LoadingText[i][0], -2.000000, 0.000000);
		TextDrawAlignment(LoadingText[i][0], 1);
		TextDrawColor(LoadingText[i][0], 0);
		TextDrawUseBox(LoadingText[i][0], true);
		TextDrawBoxColor(LoadingText[i][0], 255);
		TextDrawSetShadow(LoadingText[i][0], 0);
		TextDrawSetOutline(LoadingText[i][0], 0);
		TextDrawFont(LoadingText[i][0], 0);

		LoadingText[i][1] = TextDrawCreate(165.856536, 219.333312, "  SkyWorld Death Match");
		TextDrawLetterSize(LoadingText[i][1], 0.628974, 3.711665);
		TextDrawTextSize(LoadingText[i][1], 470.863861, 88.083351);
		TextDrawAlignment(LoadingText[i][1], 1);
		TextDrawColor(LoadingText[i][1], -192);
		TextDrawUseBox(LoadingText[i][1], true);
		TextDrawBoxColor(LoadingText[i][1], 505495039);
		TextDrawSetShadow(LoadingText[i][1], 0);
		TextDrawSetOutline(LoadingText[i][1], 1);
		TextDrawBackgroundColor(LoadingText[i][1], 51);
		TextDrawFont(LoadingText[i][1], 1);
		TextDrawSetProportional(LoadingText[i][1], 1);

		LoadingText[i][2] = TextDrawCreate(168.793563, 222.000000, "usebox");
		TextDrawLetterSize(LoadingText[i][2], 0.000000, 3.134815);
		TextDrawTextSize(LoadingText[i][2], 165.262084, 0.000000);
		TextDrawAlignment(LoadingText[i][2], 1);
		TextDrawColor(LoadingText[i][2], 0);
		TextDrawUseBox(LoadingText[i][2], true);
		TextDrawBoxColor(LoadingText[i][2], 0xc4f0c9AA);
		TextDrawSetShadow(LoadingText[i][2], 0);
		TextDrawSetOutline(LoadingText[i][2], 0);
		TextDrawFont(LoadingText[i][2], 0);

		LoadingText[i][3] = TextDrawCreate(224.421585, 198.916641, "LOADING: ACCOUNT...");
		TextDrawLetterSize(LoadingText[i][3], 0.449999, 1.600000);
		TextDrawAlignment(LoadingText[i][3], 1);
		TextDrawColor(LoadingText[i][3], -1);
		TextDrawSetShadow(LoadingText[i][3], 0);
		TextDrawSetOutline(LoadingText[i][3], 1);
		TextDrawBackgroundColor(LoadingText[i][3], 51);
		TextDrawFont(LoadingText[i][3], 2);
		TextDrawSetProportional(LoadingText[i][3], 1);
 	
		StartSkin[i][0] = TextDrawCreate(220.000000, 220.000000, "_");
		TextDrawAlignment(StartSkin[i][0], 2);
		TextDrawBackgroundColor(StartSkin[i][0], 255);
		TextDrawFont(StartSkin[i][0], 1);
		TextDrawLetterSize(StartSkin[i][0], 0.500000, 7.699999);
		TextDrawColor(StartSkin[i][0], 0xFFFFFFFF);
		TextDrawSetOutline(StartSkin[i][0], false);
		TextDrawSetProportional(StartSkin[i][0], true);
		TextDrawSetShadow(StartSkin[i][0], true);
		TextDrawUseBox(StartSkin[i][0], true);
		TextDrawBoxColor(StartSkin[i][0], 102);
		TextDrawTextSize(StartSkin[i][0], 0.000000, 80.000000);
		TextDrawSetSelectable(StartSkin[i][0], false);

		StartSkin[i][1] = TextDrawCreate(220.000000, 220.000000, "Select Skin");
		TextDrawAlignment(StartSkin[i][1], 2);
		TextDrawBackgroundColor(StartSkin[i][1], 255);
		TextDrawFont(StartSkin[i][1], 2);
		TextDrawLetterSize(StartSkin[i][1], 0.200000, 1.000000);
		TextDrawColor(StartSkin[i][1], COLOR_RED);
		TextDrawSetOutline(StartSkin[i][1], false);
		TextDrawSetProportional(StartSkin[i][1], true);
		TextDrawSetShadow(StartSkin[i][1], true);
		TextDrawSetSelectable(StartSkin[i][1], false);

		StartSkin[i][2] = TextDrawCreate(220.000000, 236.000000, "Next >>");
		TextDrawAlignment(StartSkin[i][2], 2);
		TextDrawBackgroundColor(StartSkin[i][2], 255);
		TextDrawFont(StartSkin[i][2], 1);
		TextDrawLetterSize(StartSkin[i][2], 0.400000, 1.199999);
		TextDrawColor(StartSkin[i][2], 0xFFFFFFFF);
		TextDrawSetOutline(StartSkin[i][2], false);
		TextDrawSetProportional(StartSkin[i][2], true);
		TextDrawSetShadow(StartSkin[i][2], true);
		TextDrawUseBox(StartSkin[i][2], true);
		TextDrawBoxColor(StartSkin[i][2], 255);
		TextDrawTextSize(StartSkin[i][2], 7.000000, 60.000000);
		TextDrawSetSelectable(StartSkin[i][2], true);

		StartSkin[i][3] = TextDrawCreate(220.000000, 254.000000, "Save");
		TextDrawAlignment(StartSkin[i][3], 2);
		TextDrawBackgroundColor(StartSkin[i][3], 255);
		TextDrawFont(StartSkin[i][3], 1);
		TextDrawLetterSize(StartSkin[i][3], 0.400000, 1.199999);
		TextDrawColor(StartSkin[i][3], 0xFFFFFFFF);
		TextDrawSetOutline(StartSkin[i][3], false);
		TextDrawSetProportional(StartSkin[i][3], true);
		TextDrawSetShadow(StartSkin[i][3], true);
		TextDrawUseBox(StartSkin[i][3], true);
		TextDrawBoxColor(StartSkin[i][3], 255);
		TextDrawTextSize(StartSkin[i][3], 7.000000, 60.000000);
		TextDrawSetSelectable(StartSkin[i][3], true);
	}
	return 1;
}

public OnGameModeExit()
{
    KillTimer(AFK_Timer);
    KillTimer(sTimer[0]);
    mysql_close(MYSQL_ARG);
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerCameraLookAt(playerid,-2684.6666 ,1595.6666 ,111.6666);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,playerid);
    coord[playerid] = 165.262084;
	TextDrawTextSize(LoadingText[playerid][2],165.262084,0.00000);
	for(new i;i<4;i++) TextDrawShowForPlayer(playerid, LoadingText[playerid][i]);
	while(coord[playerid] <= 520.2)
    {
        TogglePlayerControllable(playerid, 0);
		coord[playerid] = coord[playerid] + 0.317;
		TextDrawTextSize(LoadingText[playerid][2], coord[playerid], 0.000000);
		if(coord[playerid] <= 465.8) TextDrawShowForPlayer(playerid,LoadingText[playerid][2]);
		if(coord[playerid] <= 219.0) TextDrawSetString(LoadingText[playerid][3],"LOADING: TEXTURES...");
		if(coord[playerid] >= 220.1 && coord[playerid] <= 250.1) TextDrawSetString(LoadingText[playerid][3],"LOADING: MODELS...");
		if(coord[playerid] >= 250.2 && coord[playerid] <= 330.8) TextDrawSetString(LoadingText[playerid][3],"LOADING: SYNC...");
		if(coord[playerid] >= 330.9 && coord[playerid] <= 465.7) TextDrawSetString(LoadingText[playerid][3],"LOADING: ACCOUNT...");
		if(coord[playerid] >= 465.8 && coord[playerid] <= 466.1)
		{
			for(new i; i<4; i++) TextDrawHideForPlayer(playerid,LoadingText[playerid][i]);
			SendClientMessage(playerid, COLOR_BLUE, "[SkyWorld DM]: Добро пожаловать на сервер!");
		}
		if(coord[playerid] >= 520.0)
		{
		    TogglePlayerControllable(playerid, 1);
		    mysql_format(MYSQL_ARG, asd, 90, "SELECT `Name` FROM `"Baza"` WHERE `Name` = '%e'", PlayerInfo[playerid][pName]);
			mysql_function_query(MYSQL_ARG, asd, true, "Start_R_A","d", playerid);
		}
	}
 	for(FP_Spawn_Weapons_i[playerid]=0;FP_Spawn_Weapons_i[playerid]<3;++FP_Spawn_Weapons_i[playerid])
 	{
  		FP_Spawn_Weapons[playerid][FP_Spawn_Weapons_i[playerid]]=FP_Player_Class_Weapons[classid][FP_Spawn_Weapons_i[playerid]];
   	}
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	return 0;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return true;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
	{
 		case 1:
		{
  			if(!response) return Kick(playerid);
   			if(!strlen(inputtext))
			{
				new loginmsg[230];
				new name[MAX_PLAYER_NAME];
				GetPlayerName(playerid, name, sizeof(name));
				format(loginmsg,350,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {AA3333}не найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
				ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{c4f0c9}Регистрация",loginmsg,"Далее","Отмена");
			    SendClientMessage(playerid, -1, "Вы ничего не ввели");
			   	return 0;
	   		}
		    if(strlen(inputtext) < 5 || strlen(inputtext) > 15)
			{
				new loginmsg[230];
				new name[MAX_PLAYER_NAME];
				GetPlayerName(playerid, name, sizeof(name));
				format(loginmsg,350,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {AA3333}не найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
				ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{c4f0c9}Регистрация",loginmsg,"Далее","Отмена");
	   			SendClientMessage(playerid, -1, "Ваш пароль должен быть от 5 до 15 символов");
			    return 0;
       		}
			format(PlayerInfo[playerid][pPassword], 15,"%s", inputtext);
   			Reg(playerid);
			PlayerInfo[playerid][pLogged] = 1;
			SpawnPlayer(playerid);
 			SetPlayerScore(playerid,PlayerInfo[playerid][pKills]);
		}
		case 2:
		{
  			if(!response) return Kick(playerid);
	    	if(!strlen(inputtext))
			{
				new name[MAX_PLAYER_NAME];
				new loginmsg[187];
				GetPlayerName(playerid, name, sizeof(name));
				format(loginmsg,187,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {228B22}найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
				ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{c4f0c9}Авторизация",loginmsg,"Войти","Отмена");
	   			SendClientMessage(playerid, -1, "Вы ничего не ввели");
		    	return 0;
    		}
			mysql_format(MYSQL_ARG, asd,90, "SELECT * FROM `"Baza"` WHERE `Name` = '%e' AND `Password` = '%e'", PlayerInfo[playerid][pName], inputtext);
			mysql_function_query(MYSQL_ARG, asd, true, "Avtoriz","ds", playerid, inputtext);
		}
		case 4:
		{
			if(response)
			{
			    new string[256];
				if(!strlen(inputtext))return ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"{c4f0c9}Репорт","{FFFFFF}Введите своё сообщение для администрации сервера\nОно должно быть кратким и ясным\n\n{66CC66}Если вы хотите подать жалобу на игрока,\nобязательно укажите его ID и причину жалобы","Отправить","Отмена");
				new sendername[MAX_PLAYER_NAME];
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string),"[QUESTION] %s[%d]: {FFCD00}%s", sendername, playerid,inputtext);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string),"[REPORT] %s[%d]: {FFCD00}%s", sendername, playerid,inputtext);
				ABroadCast(COLOR_LIME,string,1);
			}
		}
		case 6:
		{
		    if(strval(inputtext) != admpass || !response) return Kick(playerid);
		    admloged[playerid] = 1;
		    new send[128],pip[24],send1[128];
			GetPlayerIp(playerid,pip,24);
			if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] <= 5)
			{
				format(send1,sizeof(send1),"Вы вошли как администратор %d-го уровня",PlayerInfo[playerid][pAdmin]);
				SendClientMessage(playerid, COLOR_YELLOW, send1);
			}
 			else if(PlayerInfo[playerid][pAdmin] == 6) SendClientMessage(playerid, COLOR_RED, "Вы вошли как Главный Администратор");
		    format(send,sizeof(send),"[ALogin] %s[%d] авторизовался [IP:%s]",PlayerInfo[playerid][pName],playerid,pip);
		    ABroadCast(0xff0000ff, send, 1);
			return 1;
		}
		case dg_dmGun:
		{
		    if(response)
		    {
		        switch(listitem)
		        {
		            case 0: SetPVarInt(playerid,"PlayerGun1",24), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 1: SetPVarInt(playerid,"PlayerGun1",25), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 2: SetPVarInt(playerid,"PlayerGun1",29), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 3: SetPVarInt(playerid,"PlayerGun1",30), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 4: SetPVarInt(playerid,"PlayerGun1",31), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 5: SetPVarInt(playerid,"PlayerGun1",34), ShowPlayerDialog(playerid,dg_dmGun2,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #2","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		        }
		    }
		    else ShowPlayerDialog(playerid,dg_dmGun,DIALOG_STYLE_LIST,"{C2A2DA}Выбор оружия #1","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		}
		case dg_dmGun2:
		{
		    if(response)
		    {
		        switch(listitem)
		        {
		            case 0: SetPVarInt(playerid,"PlayerGun2",24), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 1: SetPVarInt(playerid,"PlayerGun2",25), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 2: SetPVarInt(playerid,"PlayerGun2",29), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 3: SetPVarInt(playerid,"PlayerGun2",30), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 4: SetPVarInt(playerid,"PlayerGun2",31), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		            case 5: SetPVarInt(playerid,"PlayerGun2",34), ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		        }
		    }
		    else ShowPlayerDialog(playerid,dg_dmGun,DIALOG_STYLE_LIST,"{C2A2DA}Выбор оружия #1","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		}
		case dg_dmGun3:
		{
		    if(response)
		    {
		        switch(listitem)
		        {
		            case 0: SetPVarInt(playerid,"PlayerGun3",24), SpawnPlayer(playerid);
		            case 1: SetPVarInt(playerid,"PlayerGun3",25), SpawnPlayer(playerid);
		            case 2: SetPVarInt(playerid,"PlayerGun3",29), SpawnPlayer(playerid);
		            case 3: SetPVarInt(playerid,"PlayerGun3",30), SpawnPlayer(playerid);
		            case 4: SetPVarInt(playerid,"PlayerGun3",31), SpawnPlayer(playerid);
		            case 5: SetPVarInt(playerid,"PlayerGun3",34), SpawnPlayer(playerid);
		        }
		    }
		    else ShowPlayerDialog(playerid,dg_dmGun3,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #3","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
		}
		case 7: //ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "{c4f0c9}Меню Сервера", "1.Статистика Персонажа\n2.Связь с Администрацией\n3.Настройки\n4.Помощь\n5.Донат", "Выбор", "Выход");
		{
  			if(response)
     		{
       			switch(listitem)
          		{
            		case 0:
              		{
          		    	new sendername[MAX_PLAYER_NAME],gp[MAX_PLAYER_NAME], str[128],sctring[600];
                 		GetPlayerName(playerid, sendername, sizeof(sendername));
                 		GetPlayerName(playerid, gp, sizeof(gp));
                		format(str,sizeof(str),"%s\n\n",gp);
                		strcat(sctring,str);
                		format(str,sizeof(str),"{ffffff}Количество Убийств: \t\t\t%d\n",PlayerInfo[playerid][pKills]);
                		strcat(sctring,str);
                		format(str,sizeof(str),"{ffffff}Количество Смертей: \t\t\t%d\n",PlayerInfo[playerid][pDeaths]);
                		strcat(sctring,str);
                		ShowPlayerDialog(playerid,9999,DIALOG_STYLE_MSGBOX,"Информация о игроке",sctring,"Выход","");
					}
					case 1:
					{
					    ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"{c4f0c9}Репорт","{FFFFFF}Введите своё сообщение для администрации сервера\nОно должно быть кратким и ясным\n\n{66CC66}Если вы хотите подать жалобу на игрока,\nобязательно укажите его ID и причину жалобы","Отправить","Отмена");
					}
					case 2:
					{
					
					}
					case 3:
					{
					
					}
					case 4:
					{
					
					}
				}
			}
		}
	}
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	if(killerid != INVALID_PLAYER_ID && !IsPlayerConnected(killerid)) return 0;
	new Float: pos[3];
	GetVehicleRotation(vehicleid, pos[0], pos[1], pos[2]);
	if(!IsKicked(killerid) && (pos[1] < 90 && pos[1] > -90) && gVehicleDriver[vehicleid-1] == INVALID_PLAYER_ID && GetPVarInt(killerid, "lastveh") != vehicleid && killerid != INVALID_PLAYER_ID)
	{
		new mes[135];
		new Float:slx, Float:sly, Float:slz;
		GetPlayerPos(killerid, slx, sly, slz);
  		format(mes,sizeof(mes),"[Античит]: %s был кикнут по подозрению в уничтожении автомобилей читерским способом",PlayerInfo[killerid][pName]);
		ABroadCast(COLOR_GREY,mes,1);
		SendClientMessage(killerid,COLOR_RED,"Вы кинуты по подозрению в читерстве! [A-Code 2]");
		TogglePlayerControllable(killerid, 0);
		PlayerPlaySound(killerid, 6001, slx, sly, slz);
		Kick(killerid);
		return 0;
	}
	return 1;
}

stock Adminlog(admin, player, action[], amount, reason[])
{
	new query[512];
	format(query, sizeof(query), "INSERT INTO `logsadmin` (`admin`, `adminIP`, `player`, `action`, `amount`, `reason`, `date`) VALUES ( '%s', '%s', '%s', '%s', '%d', '%s', NOW() )",
	Name(admin), GetIp(admin), Name(player), action, amount, reason);
	mysql_function_query(1, query, true, "", "");
}

public OnPlayerUpdate(playerid)
{
	new mes[135];
   	new Float:Z; new anim = GetPlayerAnimationIndex(playerid); new pdame[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pdame, sizeof(pdame)); GetPlayerPos(playerid,Z,Z,Z);
    if((anim == 1538 || anim == 1539 || anim == 1543) && Z > 4 && (playerid) > 10)
	{
 		new Float:slx, Float:sly, Float:slz;
		GetPlayerPos(playerid, slx, sly, slz);
		format(mes,sizeof(mes),"[Античит]: %s Был кикнут по подозрению в FlyHack",PlayerInfo[playerid][pName]);
 		ABroadCast(0xff0000ff,mes,1);
		SendClientMessage(playerid, COLOR_RED, "Вы кикнуты по подозрению в читерстве! [A-Code 1]");
		TogglePlayerControllable(playerid, 0);
		PlayerPlaySound(playerid, 6001, slx, sly, slz);
		Kick(playerid);
	}
	if(GetPlayerCameraMode(playerid) == 53)
    {
        new Float:pos[3];
        GetPlayerCameraPos(playerid,pos[0],pos[1],pos[2]);
        if( pos[0] < -7000.0 || pos[0] > 7000.0 || pos[1] < -7000.0 || pos[1] > 7000.0 || pos[2] < -7000.0 || pos[2] > 7000.0 )
		{
		    new Float:slx, Float:sly, Float:slz;
			GetPlayerPos(playerid, slx, sly, slz);
			format(mes,sizeof(mes),"[Античит]: %s Был кикнут по подозрению в Anti-Weapon Crasher",PlayerInfo[playerid][pName]);
 			ABroadCast(0xff0000ff,mes,1);
			SendClientMessage(playerid, COLOR_RED, "Вы кикнуты по подозрению в читерстве! [A-Code 3]");
			TogglePlayerControllable(playerid, 0);
			PlayerPlaySound(playerid, 6001, slx, sly, slz);
			Kick(playerid);
		}
	}
	new gun[] = {4,9,37,38,35,36,39,44,45};
    for(new i= 0;i<sizeof(gun);i++)
    {
        if(gun[i] == GetPlayerWeapon(playerid))
        {
            new Float:slx, Float:sly, Float:slz, string[100];
			GetPlayerPos(playerid, slx, sly, slz);
            format(mes,sizeof(mes),"[Античит]: %s Был кикнут по подозрению в Bad Gun",PlayerInfo[playerid][pName]);
            ABroadCast(0xff0000ff,string,1);
            SendClientMessage(playerid, COLOR_RED, "Вы кикнуты по подозрению в читерстве! [A-Code 4]");
			TogglePlayerControllable(playerid, 0);
			PlayerPlaySound(playerid, 6001, slx, sly, slz);
            Kick(playerid);
        }
    }
    if(GetPlayerPing(playerid) >= 300)
    {
        new Float:slx, Float:sly, Float:slz, string[100];
		GetPlayerPos(playerid, slx, sly, slz);
  		format(mes,sizeof(mes),"[Античит]: %s Был кикнут по подозрению в HIGH PING (%d)",PlayerInfo[playerid][pName], GetPlayerPing(playerid));
    	ABroadCast(0xff0000ff,string,1);
        SendClientMessage(playerid, COLOR_RED, "Вы были кикнуты по подозрению в HIGH PING! [A-Code 5]");
		TogglePlayerControllable(playerid, 0);
		PlayerPlaySound(playerid, 6001, slx, sly, slz);
        Kick(playerid);
    }
    if(!IsPlayerNPC(playerid)&&GetPVarInt(playerid,"FP_Protection")==1)
	{
        FP_Special_Action[playerid]=GetPlayerSpecialAction(playerid);
        if(FP_Special_Action[playerid]!=0&&FP_Special_Action[playerid]!=1&&FP_Special_Action[playerid]!=3&&FP_Special_Action[playerid]!=4&&FP_Special_Action[playerid]!=FP_Actionid_Player[playerid])
		{
			if(FP_Special_Action_Death[playerid]==0)
			{
			    new Float:slx, Float:sly, Float:slz;
				GetPlayerPos(playerid, slx, sly, slz);
 				SendClientMessage(playerid, COLOR_RED, "Вы были кикнуты по подозрению в читерстве! [A-Code 8]");
 				TogglePlayerControllable(playerid, 0);
				PlayerPlaySound(playerid, 6001, slx, sly, slz);
   				Kick(playerid);
     		}
       	}
  	}
  	if(!IsPlayerNPC(playerid)&&GetPVarInt(playerid,"FP_Protection")==1)
  	{
   		FP_Get_Weap[playerid]=GetPlayerWeapon(playerid);
        if(FP_Weapon[playerid][FP_Get_Weap[playerid]]==0&&FP_Get_Weap[playerid]!=0&&FP_Get_Weap[playerid]!=40&&FP_Get_Weap[playerid]!=46)
		{
  			if(FP_Weap_Spawn_Pro[playerid]==0)
  			{
                new Float:slx, Float:sly, Float:slz;
				GetPlayerPos(playerid, slx, sly, slz);
 				SendClientMessage(playerid, COLOR_RED, "Вы были кикнуты по подозрению в читерстве! [A-Code 7]");
 				TogglePlayerControllable(playerid, 0);
				PlayerPlaySound(playerid, 6001, slx, sly, slz);
				Kick(playerid);
          	}
        }
  	}
	return 1;
}

stock FP_SetPlayerSpecialAction(playerid,actionid)
{
	FP_Actionid_Player[playerid]=actionid;
    return SetPlayerSpecialAction(playerid,actionid);
}

public OnRconLoginAttempt(ip[], password[], success)
{
	if(!success)
 	{
		new pip[16];
 		for(new i=0; i<GetMaxPlayers(); i++)
  		{
  			GetPlayerIp(i, pip, sizeof(pip));
    		if(!strcmp(ip, pip, true))
     		{
				SendClientMessage(i, COLOR_RED, "Вы были забанены за неверный ввод RCON пароля");
   				BanEx(i,"Попытка взлома ркона.");
  				printf("Попытка войти под рконом ip %s использовали пароль: %s",ip, password);
   			}
		}
	}
	return 1;
}

bool:emptyMessage(const string[])
{
    for(new i; string[i] != 0x0; i++)
    {
        switch(string[i])
        {
            case 0x20: continue;
            default: return false;
        }
    }
    return true;
}

public OnPlayerText(playerid, text[])
{
    new string[256];
    if(PlayerInfo[playerid][pLogged] == 1)
    {
  		new sendername[MAX_PLAYER_NAME];
	 	GetPlayerName(playerid, sendername, sizeof(sendername));
	 	format(string, sizeof(string), "{C4F0C9}%s:{FFFFFF} %s", sendername, text);
	 	SendMessageToAll(COLOR_WHITE, string);
	 	if(emptyMessage(text)) return SendClientMessage(playerid,-1,"[Пустое Сообщение]: Вы ничего не ввели!") & 0;
	 	if(IsIpFound(text))
		{
			printf("Admin %s: %s", PlayerInfo[playerid][pName], text);
			new poc[228];
			format(poc, sizeof(poc), "[Внимание]Игрок %s[%d] был кикнут за отправку IP адресса в чат", PlayerInfo[playerid][pName], playerid);
			ABroadCast(COLOR_LIGHTRED,poc,1);
			SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
			//PlayerInfo[playerid][pAdmin] = 0;
			Kick(playerid);
		}
	 	return 0;
 	}
	return true;
}

stock GetVehicleRotation(vehicleid,&Float:x,&Float:y,&Float:z) {
    new Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z;
    GetVehicleRotationQuat(vehicleid,quat_w,quat_x,quat_y,quat_z);
    x = atan2(2*((quat_x*quat_y)+(quat_w+quat_z)),(quat_w*quat_w)+(quat_x*quat_x)-(quat_y*quat_y)-(quat_z*quat_z));
    y = atan2(2*((quat_y*quat_z)+(quat_w*quat_x)),(quat_w*quat_w)-(quat_x*quat_x)-(quat_y*quat_y)+(quat_z*quat_z));
    z = asin(-2*((quat_x*quat_z)+(quat_w*quat_y)));
    return 1;
}

public OnPlayerConnect(playerid)
{
    clear(playerid);
	new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(PlayerInfo[playerid][pAdmin] > 0){god[playerid] = 0;}
    RemoveBuildingForPlayer(playerid, 3366, 276.6563, 2023.7578, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3366, 276.6563, 1989.5469, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3366, 276.6563, 1955.7656, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3267, 188.2422, 2081.6484, 22.4453, 0.25);
	RemoveBuildingForPlayer(playerid, 3277, 188.2422, 2081.6484, 22.4063, 0.25);
	RemoveBuildingForPlayer(playerid, 16294, 15.1797, 1719.3906, 21.6172, 0.25);
	RemoveBuildingForPlayer(playerid, 3267, 15.6172, 1719.1641, 22.4141, 0.25);
	RemoveBuildingForPlayer(playerid, 3277, 15.6016, 1719.1719, 22.3750, 0.25);
	RemoveBuildingForPlayer(playerid, 16093, 211.6484, 1810.1563, 20.7344, 0.25);
	RemoveBuildingForPlayer(playerid, 16638, 211.7266, 1809.1875, 18.9844, 0.25);
	RemoveBuildingForPlayer(playerid, 16670, 330.7891, 1813.2188, 17.8281, 0.25);
	RemoveBuildingForPlayer(playerid, 16095, 279.1328, 1829.7813, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3280, 245.3750, 1862.3672, 20.1328, 0.25);
	RemoveBuildingForPlayer(playerid, 3280, 246.6172, 1863.3750, 20.1328, 0.25);
	RemoveBuildingForPlayer(playerid, 16096, 120.5078, 1934.0313, 19.8281, 0.25);
	RemoveBuildingForPlayer(playerid, 16671, 193.9531, 2051.7969, 20.1797, 0.25);
	RemoveBuildingForPlayer(playerid, 3268, 276.6563, 2023.7578, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3268, 276.6563, 1989.5469, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3268, 276.6563, 1955.7656, 16.6328, 0.25);
	RemoveBuildingForPlayer(playerid, 3267, 354.4297, 2028.4922, 22.4141, 0.25);
	RemoveBuildingForPlayer(playerid, 3277, 354.4141, 2028.5000, 22.3750, 0.25);
	RemoveBuildingForPlayer(playerid, 16668, 357.9375, 2049.4219, 16.8438, 0.25);
	RemoveBuildingForPlayer(playerid, 16669, 380.2578, 1914.9609, 17.4297, 0.25);
	RemoveBuildingForPlayer(playerid, 1411, 347.1953, 1799.2656, 18.7578, 0.25);
	RemoveBuildingForPlayer(playerid, 1411, 342.9375, 1796.2891, 18.7578, 0.25);
	RemoveBuildingForPlayer(playerid, 1278, 1117.2813, 1204.7109, 23.9375, 0.25);
	RemoveBuildingForPlayer(playerid, 1278, 1136.9766, 1204.7109, 23.9375, 0.25);
    TextDrawShowForPlayer(playerid,Textdraw0);
    TextDrawShowForPlayer(playerid,Textdraw1);
    new PlName[MAX_PLAYER_NAME],count;
	GetPlayerName(playerid,PlName,sizeof(PlName));
	for (new i; i < strlen(PlName); i++)
	{
	    if (PlName[i] >= '0' && PlName[i] <= '9')
 	   {
	        count++;
	        if(count == 4)
     	   {
         	   SendClientMessage(playerid,0xE0EA64AA,"В вашем нике более 3 цифр!");
         	   Kick(playerid);
         	   break;
     	   }
 	   }
	}
	new desti[32];
	GetPlayerVersion(playerid, desti, sizeof(desti));
	if(strcmp(desti, "unknown", true) == 0)
	{
		format(client, sizeof(client), ">>>> Ruskadance's AntiAttack: %s[%d] использовал DedaVanya", PlayerInfo, playerid);
	    printf(client);
	    BanEx(playerid, "DedaVanya");
	}
	SetPlayerCameraPos(playerid,1286.8842,-1928.8975,112.6132);
	SetPlayerCameraLookAt(playerid,1461.5205,-1812.0117,74.5301);
	//ShowPlayerDialog(playerid, 3,DIALOG_STYLE_MSGBOX,"{c4f0c9}>> Загрузка Сервера", "{ffffff}Добро пожаловать на сервер!\nПодождите пожалуйста пару секунду\nВыполняется загрузка сервера!\nДля продолжения нажмите кнопку 'Далее'" ,"Далее","Отмена");
    SetPlayerColor(playerid,0xFFFFFF80);
    GetPlayerName(playerid, PlayerInfo[playerid][pName], 24);
    
   	TextDrawHideForPlayer(playerid,StartSkin[playerid][0]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][1]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][2]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][3]);
    
    GetPlayerName(playerid, pPlayerName[playerid], MAX_PLAYER_NAME);
	format(querybans, sizeof(querybans), "SELECT * FROM `Bans` WHERE `Name` = '%s'", GetName(playerid)); // Форматируем запрос в бд
	mysql_function_query(1, querybans, true, "CheckBan", "d", playerid); // Отправляем запрос.
	
	new connect_ip[32+1];
	GetPlayerIp(playerid,connect_ip,32);
	new num_ip = GetNumberOfPlayersOnThisIP(connect_ip);
	if(num_ip > MAX_IP)
	{
		Kick(playerid);
		return 1;
	}
	for(FP_Ammo_Weapon_i[playerid]=0;FP_Ammo_Weapon_i[playerid]<47;FP_Ammo_Weapon_i[playerid]++)
	{
            FP_Weapon[playerid][FP_Ammo_Weapon_i[playerid]]=0;
    }
    FP_Weap_Spawn_Pro[playerid]=1;
	return 1;
}

stock GetNumberOfPlayersOnThisIP(test_ip[])
{
	new against_ip[32+1];
	new x = 0;
	new ip_count = 0;
	for(x=0; x<MAX_PLAYERS; x++)
	{
		if(IsPlayerConnected(x))
		{
			GetPlayerIp(x,against_ip,32);
			if(!strcmp(against_ip,test_ip)) ip_count++;
		}
	}
	return ip_count;
}

fpub:CheckBanIP(playerid)
{
	new unbandate;
	new rows,fields;
	cache_get_data(rows, fields);
	if(rows)
	{
		unbandate = cache_get_field_content_int(0, "UnbanDate");
		if(gettime() >= unbandate)// Если сейчас дата больше чем та что была записана при бане, разбаниваем игрока
		{
			format(querybans, sizeof(querybans), "DELETE FROM `Bans` WHERE `Name` = '%s'",GetName(playerid)); // Форматируем.
			mysql_function_query(1, querybans, false, "",""); // Отправляем запрос.
			return true;
		}
		else// Иначе выводим диалог что посиди еще в бане, время не вышло.
		{
			new str[250];
			format(str, sizeof(str),"{ffffff}Добро пожаловать на сервер!\nВаш аккаунт заблокирован!\n\nДата разбана: %s",date("%dd/%mm/%yyyy в %hh:%ii:%ss",unbandate));
			ShowPlayerDialog(playerid,91,0,"{c4f0c9}Аккаунт Заблокирован:",str,"Ok","");
			Kick(playerid);
		}
	}
	return true;
}

fpub:CheckBan(playerid)
{
	new rows,fields;
	new unbandate;
	cache_get_data(rows, fields);
	if(rows)
	{
		unbandate = cache_get_field_content_int(0, "UnbanDate"); //
		if(gettime() >= unbandate) // Если сейчас дата больше чем та что была записана при бане, разбаниваем игрока
		{
			format(querybans, sizeof(querybans), "DELETE FROM `Bans` WHERE `Name` = '%s'",GetName(playerid)); // форматируем.
			mysql_function_query(1, querybans, false, "","");// Отправляем запрос.
			return true;
		}
		else // Иначе выводим диалог что посиди еще в бане, время не вышло.
		{
			new str[250];
   			format(str, sizeof(str),"{ffffff}Добро пожаловать на сервер!\nВаш аккаунт заблокирован!\n\nДата разбана: %s",date("%dd/%mm/%yyyy в %hh:%ii:%ss",unbandate));
			ShowPlayerDialog(playerid,91,0,"{c4f0c9}Аккаунт Заблокирован:",str,"Ok","");
			Kick(playerid);
		}
	}
	return true;
}

fpub:Unban(i,nick[])
{
	new rows,fields;
	cache_get_data(rows, fields);
	if(!rows) // Если в бд строки не найдены
	{
		SendClientMessage(i,COLOR_GREY,"Игрока с данным ник-неймом нет в базе банов");
	}
	else // Иначе(если найдены)
	{
	    new string[256];
		format(string, sizeof(string), "Администратор %s[%d] разбанил игрока %s.",GetName(i), i, nick);
		SendAdminMessage(COLOR_GREY, string);
		format(querybans, sizeof(querybans), "DELETE FROM `Bans` WHERE `Name` = '%s'",nick);// Форматируем запрос в бд
		mysql_function_query(1, querybans, false, "",""); // отправляем запрос.
	}
	return true;
}

stock CreateTimers()
{
 	sTimer[0] = SetTimer("Fresh", 1000, true);
}

public AFKCheck()
{
    new Float:AFKCoords[3];
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
        if(PlayerInfo[i][pLogged] == 0) continue;
        if(IsPlayerNPC(i)) continue;
        if(PlayerAFK[i][AFK_Time] >= 600)
		{
		    if(PlayerInfo[i][pAdmin] >= 1) return 1;
		    else
		    {
				SendClientMessage(i,COLOR_RED,"Время Афк привышено вы были кикнуты");
				Kick(i);
			}
		}
        GetPlayerPos(i,AFKCoords[0],AFKCoords[1],AFKCoords[2]);
        if(AFKCoords[0] == PlayerAFK[i][AFK_Coord]) PlayerAFK[i][AFK_Time]++;
        else
        {
            PlayerAFK[i][AFK_Time] = 0;
            if(PlayerAFK[i][AFK_Stat] != 0) Delete3DTextLabel(AFK_3DT[i]), PlayerAFK[i][AFK_Stat] = 0;
        }
        PlayerAFK[i][AFK_Coord] = AFKCoords[0];
        if(PlayerAFK[i][AFK_Time] == AFK_TEXT_SET && PlayerAFK[i][AFK_Stat] == 0)
        {
            AFK_3DT[i] = Create3DTextLabel("{ff8800}На паузе: {ffffff}0 {ff8800}секунд", COLOR_RED, 0.00, 0.00, 10000.0, T_DIST, 0);
            Attach3DTextLabelToPlayer(AFK_3DT[i], i, 0.0, 0.0, 0.3);
            PlayerAFK[i][AFK_Stat] = 1;
        }
        if(PlayerAFK[i][AFK_Stat] == 1)
        {
           new str[256]; f(str,"{ff8800}На паузе: {ffffff}%d {ff8800}секунд",PlayerAFK[i][AFK_Time]);
           Update3DTextLabelText(AFK_3DT[i], COLOR_RED, str);
        }
        if(PlayerInfo[i][pAdmin] == 0) continue;
    }
    return true;
}

public OnPlayerDisconnect(playerid, reason)
{
    PlayerAFK[playerid][AFK_Time] = 0;
    if(PlayerAFK[playerid][AFK_Stat] != 0) Delete3DTextLabel(AFK_3DT[playerid]), PlayerAFK[playerid][AFK_Stat] = 0;
	Save(playerid);
	return 1;
}

public Fresh()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(PlayerInfo[i][pJailed] == 1)
		{
			PlayerInfo[i][pJailTime]--;
			if(PlayerInfo[i][pJailTime] == 1)
			{
				PlayerInfo[i][pJailed] = 0;
				PlayerInfo[i][pJailTime] = 0;
				SendClientMessage(i,-1,"{228B22}• [Успешно]: {ffffff} Срок заключения истек. Вы освобождены!");
				SpawnPlayer(i);
			}
		}
	}
	return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPVarInt(playerid,"FP_Protection",1);
    FP_Special_Action_Death[playerid]=0;
    
    FP_Weap_Spawn_Pro[playerid]=0;
    for(FP_Spawn_Weapons_i[playerid]=0;FP_Spawn_Weapons_i[playerid]<3;++FP_Spawn_Weapons_i[playerid])
	{
                FP_Weapon[playerid][FP_Spawn_Weapons[playerid][FP_Spawn_Weapons_i[playerid]]]=1;
    }
	if(PlayerInfo[playerid][pLogged] == 0)
	{
   		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы были кикнуты с сервера, Причина: Необходимо авторизоваться!");
		Kick(playerid);
		return true;
	}
	if(skin[playerid] == false)
	{
		TogglePlayerControllable(playerid, 0);
		SetPlayerVirtualWorld(playerid,playerid);
		SetPlayerHealth(playerid,100);
		SetPlayerPos(playerid,-2684.5952,1595.1729,111.2788);
		SetPlayerFacingAngle(playerid,177.2641);
		SetPlayerCameraPos(playerid,-2684.5952,1592.1729,111.2788);
		SetPlayerCameraLookAt(playerid,-2684.5952,1595.1729,111.2788);
		SetPlayerSkin(playerid,229);
		TextDrawShowForPlayer(playerid,StartSkin[playerid][0]);
		TextDrawShowForPlayer(playerid,StartSkin[playerid][1]);
		TextDrawShowForPlayer(playerid,StartSkin[playerid][2]);
		TextDrawShowForPlayer(playerid,StartSkin[playerid][3]);
		SelectTextDraw(playerid,COLOR_RED);
		SetPVarInt(playerid,"ShowTD",1);
		return true;
	}
	else
	{
	    if(PlayerInfo[playerid][pJailed] == 1)
		{
		    SetPlayerHealth(playerid,100);
		    SetPlayerInterior(playerid, 6);
			SetPlayerPos(playerid,264.1425,77.4712,1001.0391);
			SetPlayerFacingAngle(playerid, 263.0160);
			SetPlayerVirtualWorld(playerid,1);
			SetPlayerColor(playerid,COLOR_BLACK);
		}
		else
		{
	    	switch(GetPVarInt(playerid,"gMission"))
    		{
    	    	case 0:
	        	{
         			SetPlayerHealth(playerid,100);
	    			SetPlayerInterior(playerid, 0);
					SetPlayerVirtualWorld(playerid,0);
					SetPlayerColor(playerid,COLOR_GREY);
	   				new Random = random(sizeof(RandomSpawns));
					SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
					SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
     			}
        		case 1:
        		{
      				GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun1"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun2"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun3"),1000);
   					SetPlayerHealth(playerid,100);
	    			SetPlayerInterior(playerid, 0);
		    		SetPlayerVirtualWorld(playerid,1);
					new rand = random(sizeof(DM1));
					SetPlayerPos(playerid, DM1[rand][0], DM1[rand][1], DM1[rand][2]);
					SetPlayerColor(playerid,0xB74900FF);
   				}
     			case 2:
      			{
       				GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun1"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun2"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun3"),1000);
   					SetPlayerHealth(playerid,100);
		    		SetPlayerInterior(playerid, 0);
		    		SetPlayerVirtualWorld(playerid,2);
					new rand = random(sizeof(DM2));
					SetPlayerPos(playerid, DM2[rand][0], DM2[rand][1], DM2[rand][2]);
					SetPlayerColor(playerid,0xB74900FF);
   				}
   				case 3:
      			{
      		    	GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun1"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun2"),1000);
					GivePlayerWeapon(playerid, GetPVarInt(playerid,"PlayerGun3"),1000);
    				SetPlayerHealth(playerid,100);
			    	SetPlayerInterior(playerid, 0);
			    	SetPlayerVirtualWorld(playerid,3);
					new rand = random(sizeof(DM3));
					SetPlayerPos(playerid, DM3[rand][0], DM3[rand][1], DM3[rand][2]);
					SetPlayerColor(playerid,0xB74900FF);
    			}
			}
		}
	}
	TextDrawHideForPlayer(playerid,StartSkin[playerid][0]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][1]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][2]);
	TextDrawHideForPlayer(playerid,StartSkin[playerid][3]);
	CancelSelectTextDraw(playerid);
	DeletePVar(playerid,"ShowTD");
	SetPlayerSkin(playerid,GetPVarInt(playerid,"startskin"));
   	return true;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	new kills = PlayerInfo[killerid][pKills];
	new deaths = PlayerInfo[killerid][pDeaths];
    PlayerInfo[killerid][pKills] = kills+1;//+score
    PlayerInfo[playerid][pDeaths] = deaths+1;//+dead
	Save(playerid);
	Save(killerid);
	SetPlayerScore(killerid, PlayerInfo[killerid][pKills]);
	
	new mes[200];
	format(mes,sizeof(mes),"[Античит]: %s был кикнут по подозрению в использовании AIM",PlayerInfo[playerid][pName]);
    if(killerid == INVALID_PLAYER_ID) return 1;
    else if(GetPlayerWeapon(killerid) != reason) return ABroadCast(COLOR_GREY, mes, 1), Kick(playerid);
    else if(!IsPlayerInRangeOfPlayer(2.0, playerid, killerid) && GetPlayerWeapon(killerid) == 0)
	{
		SendClientMessage(playerid, COLOR_RED, "Вы были кикнуты по подозрению в читерстве! [A-Code 7]");
		ABroadCast(COLOR_GREY, mes, 1), Kick(playerid);
	}
	FP_Actionid_Player[playerid]=0;
    FP_Special_Action_Death[playerid]=1;
    
    for(FP_Ammo_Weapon_i[playerid]=0;FP_Ammo_Weapon_i[playerid]<47;FP_Ammo_Weapon_i[playerid]++)
	{
            FP_Weapon[playerid][FP_Ammo_Weapon_i[playerid]]=0;
    }
    //ResetPlayerWeapons(playerid);
    FP_Weap_Spawn_Pro[playerid]=1;
	return true;
}

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
	if(damagedid == INVALID_PLAYER_ID || !CheckFireArm(GetPlayerWeapon(playerid)) || GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID) return true;
	new count = GetPVarInt(playerid, "aimcount"), ticks = GetPVarInt(playerid, "aimtick"), currtick = GetTickCount();
	if(currtick - ticks <= 10000 && count + 1 >= MAX_AIM_TICKS)
	{
		new mes[256];
		new Float:slx, Float:sly, Float:slz;
		GetPlayerPos(playerid, slx, sly, slz);
  		format(mes,sizeof(mes),"[Античит]: %s был кикнут по подозрению в использовании AIM",PlayerInfo[playerid][pName]);
		ABroadCast(COLOR_GREY,mes,1);
		SendClientMessage(playerid,COLOR_RED,"Вы кинуты по подозрению в читерстве! [A-Code 6]");
		TogglePlayerControllable(playerid, 0);
		PlayerPlaySound(playerid, 6001, slx, sly, slz);
        Kick(playerid);
  	}
   	else if(currtick - ticks > 10000)
   	{
    	DeletePVar(playerid, "aimcount");
        DeletePVar(playerid, "aimtick");
        count = 0;
        currtick = GetTickCount();
   	}
    SetPVarInt(playerid, "aimcount", count + 1);
    SetPVarInt(playerid, "aimtick", currtick);
   	return true;
}
CheckFireArm(weaponid) {
        switch(weaponid) {
                case 16..39, 41..43: return true;
                default: return 0;
        }
        return 0;
}

stock Converts(number)
{
	new hours = 0, mins = 0, secs = 0, string[30];
	hours = floatround(number / 3600);
	mins = floatround((number / 60) - (hours * 60));
	secs = floatround(number - ((hours * 3600) + (mins * 60)));
	if(hours > 0)
	{
		format(string, 30, "%d:%02d:%02d", hours, mins, secs);
	}
	else
	{
		format(string, 30, "%d:%02d", mins, secs);
	}
	return string;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return true;
}

public UpdateJailZone()
{
	for(new i; i < GetMaxPlayers(); i++)
    {
    	if(IsPlayerConnected(i))
     	{
			if(skin[i] == true)
			{
    			if(PlayerInfo[i][pJailed] == 1)
      			{
        			if(!IsPlayerInRangeOfPoint(i, 6.0, 264.1425,77.4712,1001.0391))
          			{
            			new string[128];
              			new name[MAX_PLAYER_NAME];
                    	GetPlayerName(i, name, sizeof(name));
                   		SetPlayerInterior(i, 6);//И если его там нет , то его телепортирует в 6 интерьер , то есть клетка кпз
                    	SetPlayerPos(i,264.6288,77.5742,1001.0391);//И в телепортирует в эти координаты , измените если у вас другие
                    	format(string,sizeof(string),"[Античит]: Игрок %s пытается сбежать из тюрьмы читерским способом! /sp [%d] чтобы проверить",name, i);//Ну понятно , сообщение для администраторов
                    	ABroadCast(COLOR_GREY,string,1);
                    	SetPlayerVirtualWorld(i,1);
					}
				}
           	}
      	}
	}
 	return 1;
}

stock GetPlayerID(Name[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
 	{
		if(!strcmp(Name, PlayerInfo[i][pName])) return i;
	}
    return -1;
}

stock load_obj()
{
    CreateObject(8661, 1527.85559, -2174.87744, 12.56350, 0.00000, 0.00000, 179.99451);
	CreateObject(8661, 1516.51953, -2175.01465, 12.56050, 0.00000, 0.00000, 179.99451);
	CreateObject(8673, 1526.69031, -2156.57837, 14.02737, 0.00000, 0.00000, 0.00000);
	CreateObject(8673, 1507.22119, -2156.56494, 14.02737, 0.00000, 0.00000, 0.00000);
	CreateObject(9583, 1496.73743, -2156.70239, 16.15531, 0.00000, 179.99451, 0.00000);
	CreateObject(8673, 1496.60156, -2174.91895, 14.02737, 0.00000, 0.00000, 90.00000);
	CreateObject(9583, 1496.69238, -2185.15332, 16.15531, 0.00000, 179.99451, 0.00000);
	CreateObject(8673, 1537.71045, -2184.96289, 14.02737, 0.00000, 0.00000, 0.00000);
	CreateObject(9583, 1547.70801, -2185.00879, 16.15531, 0.00000, 179.99451, 0.00000);
	CreateObject(638, 1538.32605, -2168.24902, 13.25749, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1538.31799, -2170.00659, 13.12478, 0.00000, 0.00000, 0.00000);
	CreateObject(638, 1536.10413, -2166.74316, 13.25749, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1536.04773, -2169.17236, 13.12478, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1536.13159, -2184.56641, 13.12478, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1496.90063, -2165.73071, 13.12478, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1543.79102, -2276.42383, 13.11120, 0.00000, 0.00000, 0.00000);
	CreateObject(984, 1559.64160, -2276.41113, 13.18355, 0.00000, 0.00000, 90.24170);
	CreateObject(968, 1544.75000, -2276.35938, 13.45826, 0.00000, 0.00000, 0.00000);
	CreateObject(966, 1544.82227, -2276.36328, 12.55051, 0.00000, 0.00000, 179.99451);
	CreateObject(1215, 1552.52344, -2276.35156, 13.11120, 0.00000, 0.00000, 0.00000);
	CreateObject(982, 1451.61694, -2204.72192, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1425.99719, -2204.72412, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1400.38318, -2204.71875, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1374.76648, -2204.71973, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(984, 1360.11926, -2210.84351, 13.18355, 0.00000, 0.00000, 163.25000);
	CreateObject(984, 1357.71350, -2223.34863, 13.18355, 0.00000, 0.00000, 174.99585);
	CreateObject(984, 1357.11011, -2236.13403, 13.18355, 0.00000, 0.00000, 179.49573);
	CreateObject(984, 1357.03821, -2244.13403, 13.18355, 0.00000, 0.00000, 179.49463);
	CreateObject(983, 1357.32373, -2253.72095, 13.23043, 0.00000, 0.00000, 186.24719);
	CreateObject(983, 1358.84534, -2259.86743, 13.23043, 0.00000, 0.00000, 201.74573);
	CreateObject(983, 1361.91406, -2265.43042, 13.23043, 0.00000, 0.00000, 215.99194);
	CreateObject(983, 1366.21924, -2270.10571, 13.23043, 0.00000, 0.00000, 229.49022);
	CreateObject(983, 1371.53833, -2273.58789, 13.23043, 0.00000, 0.00000, 243.98792);
	CreateObject(983, 1377.56738, -2275.60962, 13.23043, 0.00000, 0.00000, 258.73438);
	CreateObject(982, 1393.48523, -2276.25562, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(983, 1464.69019, -2227.45850, 13.23043, 0.00000, 0.00000, 1.00000);
	CreateObject(983, 1464.38232, -2207.93457, 13.23043, 0.00000, 0.00000, 358.74756);
	CreateObject(4639, 1463.37854, -2221.87964, 14.24345, 0.00000, 0.00000, 269.74707);
	CreateObject(966, 1464.06091, -2219.24561, 12.55051, 0.00000, 0.00000, 267.99451);
	CreateObject(968, 1464.07800, -2219.25757, 13.45826, 0.00000, 358.75000, 88.00000);
	CreateObject(1215, 1464.35645, -2223.92163, 13.11120, 0.00000, 0.00000, 0.00000);
	CreateObject(1215, 1464.42114, -2211.73462, 13.11120, 0.00000, 0.00000, 0.00000);
	CreateObject(984, 1559.66467, -2296.58862, 13.18355, 0.00000, 0.00000, 89.49170);
	CreateObject(984, 1536.78967, -2296.47168, 13.18355, 0.00000, 0.00000, 89.48914);
	CreateObject(983, 1529.98743, -2299.58203, 13.23043, 0.00000, 0.00000, 352.74756);
	CreateObject(983, 1529.36865, -2304.33447, 13.23043, 0.00000, 0.00000, 352.74353);
	CreateObject(983, 1527.85413, -2310.50659, 13.23043, 0.00000, 0.00000, 339.24353);
	CreateObject(983, 1526.15625, -2314.98535, 13.23043, 0.00000, 0.00000, 339.24133);
	CreateObject(983, 1523.19312, -2320.59790, 13.23043, 0.00000, 0.00000, 324.99133);
	CreateObject(983, 1520.44141, -2324.53174, 13.23043, 0.00000, 0.00000, 324.98657);
	CreateObject(983, 1516.18762, -2329.23755, 13.23043, 0.00000, 0.00000, 310.98657);
	CreateObject(983, 1512.56750, -2332.38013, 13.23043, 0.00000, 0.00000, 310.98450);
	CreateObject(983, 1507.27502, -2335.90308, 13.23043, 0.00000, 0.00000, 296.23450);
	CreateObject(983, 1501.52881, -2338.73389, 13.23043, 0.00000, 0.00000, 296.22986);
	CreateObject(984, 1492.33789, -2341.14331, 13.18355, 0.00000, 359.75000, 98.98914);
	CreateObject(984, 1490.73499, -2341.40942, 13.18355, 0.00000, 359.74731, 98.98685);
	CreateObject(982, 1484.40796, -2355.21118, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(982, 1497.21033, -2368.00488, 13.23821, 0.00000, 0.00000, 89.99475);
	CreateObject(982, 1522.82739, -2368.00586, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1548.43518, -2368.01245, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1574.05090, -2368.01855, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1599.65869, -2368.02612, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1602.06287, -2368.00806, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1566.07104, -2309.45947, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(982, 1566.07190, -2325.45557, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(982, 1566.07654, -2263.59424, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(982, 1566.07764, -2249.21143, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(984, 1536.77673, -2276.47290, 13.18355, 0.00000, 0.00000, 90.24170);
	CreateObject(983, 1529.89136, -2273.30762, 13.23043, 0.00000, 0.00000, 8.74353);
	CreateObject(983, 1528.90479, -2266.98438, 13.23043, 0.00000, 0.00000, 8.98962);
	CreateObject(983, 1528.65784, -2265.39478, 13.23043, 0.00000, 0.00000, 8.98682);
	CreateObject(984, 1525.31470, -2256.48413, 13.18355, 0.00000, 0.00000, 26.24170);
	CreateObject(984, 1518.18762, -2245.98511, 13.18355, 0.00000, 0.00000, 41.99084);
	CreateObject(983, 1511.26770, -2239.39771, 13.23043, 0.00000, 0.00000, 55.23682);
	CreateObject(983, 1508.62524, -2237.56592, 13.23043, 0.00000, 0.00000, 55.23376);
	CreateObject(983, 1503.00110, -2234.60425, 13.23043, 0.00000, 0.00000, 69.23376);
	CreateObject(983, 1498.50818, -2232.90088, 13.23043, 0.00000, 0.00000, 69.23035);
	CreateObject(983, 1492.32666, -2231.41284, 13.23043, 0.00000, 0.00000, 83.73035);
	CreateObject(983, 1487.55151, -2230.88721, 13.23043, 0.00000, 0.00000, 83.72681);
	CreateObject(982, 1484.37976, -2217.74268, 13.23821, 0.00000, 0.00000, 179.99451);
	CreateObject(982, 1497.16418, -2204.93823, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1522.77844, -2204.93579, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1548.39136, -2204.93506, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1574.00293, -2204.93555, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1599.62158, -2204.93921, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1602.06445, -2204.94067, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(983, 1464.38196, -2364.93408, 13.23043, 0.00000, 0.00000, 359.74756);
	CreateObject(983, 1464.39392, -2345.53320, 13.23043, 0.00000, 0.00000, 359.74731);
	CreateObject(983, 1461.22839, -2341.97729, 13.23043, 0.00000, 0.00000, 263.22986);
	CreateObject(983, 1456.47400, -2341.41870, 13.23043, 0.00000, 0.00000, 263.22693);
	CreateObject(983, 1450.29358, -2339.90845, 13.23043, 0.00000, 0.00000, 249.22693);
	CreateObject(983, 1445.80115, -2338.20337, 13.23043, 0.00000, 0.00000, 249.22485);
	CreateObject(983, 1440.17407, -2335.24072, 13.23043, 0.00000, 0.00000, 235.22487);
	CreateObject(983, 1436.23230, -2332.50391, 13.23043, 0.00000, 0.00000, 235.22278);
	CreateObject(983, 1431.51221, -2328.24194, 13.23043, 0.00000, 0.00000, 220.72278);
	CreateObject(983, 1428.37903, -2324.60962, 13.23043, 0.00000, 0.00000, 220.72083);
	CreateObject(983, 1424.87402, -2319.31226, 13.23043, 0.00000, 0.00000, 206.22083);
	CreateObject(983, 1422.04248, -2313.56543, 13.23043, 0.00000, 0.00000, 206.21887);
	CreateObject(984, 1419.63110, -2304.32422, 13.18355, 0.00000, 359.74731, 8.98682);
	CreateObject(984, 1419.37976, -2302.73706, 13.18355, 0.00000, 359.74731, 8.98132);
	CreateObject(982, 1405.57764, -2296.42749, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1394.37988, -2296.42310, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(983, 1378.44751, -2296.98242, 13.23043, 0.00000, 358.00000, 280.73352);
	CreateObject(983, 1372.39282, -2298.93335, 13.23043, 0.00000, 357.99500, 295.22815);
	CreateObject(983, 1370.95642, -2299.61157, 13.23043, 0.00000, 357.98950, 295.22461);
	CreateObject(983, 1365.79761, -2303.22900, 13.23043, 0.00000, 357.98950, 314.97461);
	CreateObject(983, 1361.58606, -2308.03418, 13.23043, 0.00000, 357.98950, 322.47256);
	CreateObject(983, 1358.57849, -2313.58057, 13.23043, 0.00000, 357.73950, 340.72070);
	CreateObject(983, 1357.18250, -2319.83350, 13.23043, 0.00000, 357.73682, 353.96899);
	CreateObject(984, 1356.88257, -2329.45996, 13.18355, 0.00000, 359.74731, 0.23132);
	CreateObject(984, 1356.90820, -2335.85742, 13.18355, 0.00000, 359.74731, 0.23071);
	CreateObject(982, 1357.77625, -2355.07153, 13.23821, 0.00000, 0.00000, 183.74457);
	CreateObject(982, 1451.53479, -2368.14258, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1425.91760, -2368.13745, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1400.30359, -2368.13745, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(982, 1374.60498, -2368.04614, 13.23821, 0.00000, 0.00000, 89.49451);
	CreateObject(982, 1371.40100, -2368.01172, 13.23821, 0.00000, 0.00000, 89.48914);
	CreateObject(982, 1406.28223, -2276.25952, 13.23821, 0.00000, 0.00000, 89.99451);
	CreateObject(984, 1419.81775, -2269.89941, 13.18355, 0.00000, 0.00000, 173.49463);
	CreateObject(983, 1421.69031, -2260.53027, 13.23043, 0.00000, 0.00000, 338.98441);
	CreateObject(983, 1422.84119, -2257.53345, 13.23043, 0.00000, 0.00000, 338.98315);
	CreateObject(983, 1425.82825, -2251.91382, 13.23043, 0.00000, 0.00000, 324.98318);
	CreateObject(983, 1428.58044, -2247.98584, 13.23043, 0.00000, 0.00000, 324.98108);
	CreateObject(983, 1432.82678, -2243.24976, 13.23043, 0.00000, 0.00000, 311.23111);
	CreateObject(983, 1436.43042, -2240.08887, 13.23043, 0.00000, 0.00000, 311.22620);
	CreateObject(983, 1441.72864, -2236.58252, 13.23043, 0.00000, 0.00000, 295.97623);
	CreateObject(983, 1447.53125, -2233.87769, 13.23043, 0.00000, 0.00000, 293.97168);
	CreateObject(983, 1453.63660, -2232.10645, 13.23043, 0.00000, 0.00000, 278.46667);
	CreateObject(983, 1459.98267, -2231.23145, 13.23043, 0.00000, 0.00000, 277.21497);
	CreateObject(983, 1461.56726, -2231.02979, 13.23043, 0.00000, 0.00000, 277.21252);
	CreateObject(4639, 1463.35535, -2359.42896, 14.24345, 0.00000, 0.00000, 269.74182);
	CreateObject(2773,1681.9499512,-2334.9189453,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (1)
	CreateObject(2773,1681.9499512,-2332.9970703,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (2)
	CreateObject(2773,1681.9499512,-2331.0778809,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (3)
	CreateObject(2773,1681.9499512,-2329.1550293,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (4)
	CreateObject(2773,1681.9499512,-2327.2290039,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (5)
	CreateObject(2773,1689.5090332,-2334.9189453,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (6)
	CreateObject(2773,1689.5090332,-2332.9960938,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (7)
	CreateObject(2773,1689.5090332,-2331.0720215,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (8)
	CreateObject(2773,1689.5090332,-2329.1459961,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (9)
	CreateObject(2773,1689.5090332,-2327.2270508,13.0640001,0.0000000,0.0000000,0.0000 ); //object(cj_airprt_bar) (10)
	CreateObject(19425,1730.0660400,-2309.0029297,12.3760004,0.0000000,0.0000000,0.0000 ); //object(speed_bump01) (1)
	CreateObject(19425,1735.1099854,-2308.9880371,12.3760004,0.0000000,0.0000000,0.0000 ); //object(speed_bump01) (2)
	CreateObject(19425,1578.6390381,-2308.8569336,12.3789997,0.0000000,0.0000000,0.0000 ); //object(speed_bump01) (3)
	CreateObject(19425,1573.6689453,-2308.8569336,12.3789997,0.0000000,0.0000000,0.0000 ); //object(speed_bump01) (4)
	CreateObject(19425,1711.6240234,-2316.7438965,12.3830004,0.0000000,0.0000000,90.000 ); //object(speed_bump01) (5)
	CreateObject(19425,1711.6240234,-2321.7980957,12.3830004,0.0000000,0.0000000,90.000 ); //object(speed_bump01) (6)
	CreateObject(19425,1649.1829834,-2321.7351074,12.3830004,0.0000000,0.0000000,90.000 ); //object(speed_bump01) (7)
	CreateObject(19425,1649.1829834,-2316.7080078,12.3830004,0.0000000,0.0000000,90.000 ); //object(speed_bump01) (8)
	CreateObject(19450,1687.4720459,-2331.1411133,10.8219995,0.0000000,0.0000000,0.0000 ); //object(wall090) (1)
	CreateObject(19450,1684.0350342,-2331.1411133,10.8219995,0.0000000,0.0000000,0.0000 ); //object(wall090) (2)
	CreateObject(19431,1686.5889893,-2326.4130859,10.8219995,0.0000000,0.0000000,90.000 ); //object(wall071) (1)
	CreateObject(19431,1684.9870605,-2326.4130859,10.8219995,0.0000000,0.0000000,90.000 ); //object(wall071) (2)
	CreateObject(19431,1684.7550049,-2326.4130859,10.8219995,0.0000000,0.0000000,90.000 ); //object(wall071) (3)
	CreateObject(19448,1685.6989746,-2331.1640625,12.4720001,0.0000000,90.0000000,0.000 ); //object(wall088) (1)
	CreateObject(982, 1566.07190, -2351.08472, 13.23820, 0.00000, 0.00000, 179.99451);
	CreateObject(983, 1566.11963, -2364.76099, 13.23820, 0.00000, 0.00000, 0.00000);
	CreateObject(982, 1566.09155, -2223.62744, 13.23820, 0.00000, 0.00000, 179.99451);
	CreateObject(983, 1566.17285, -2208.06299, 13.23820, 0.00000, 0.00000, 0.00000);
	CreateObject(982, 1566.07190, -2351.08472, 13.23820, 0.00000, 0.00000, 179.99451);
	CreateObject(983, 1566.11963, -2364.76099, 13.23820, 0.00000, 0.00000, 0.00000);
	CreateObject(982, 1566.09155, -2223.62744, 13.23820, 0.00000, 0.00000, 179.99451);
	CreateObject(983, 1566.17285, -2208.06299, 13.23820, 0.00000, 0.00000, 0.00000);
	CreateObject(18234, 1534.28992, -2329.86841, 12.53060, 0.00000, 0.00000, 180.00000);
	CreateObject(4639, 1543.82788, -2297.25269, 14.16480, 0.00000, 0.00000, 0.00000);
	CreateObject(966, 1545.81030, -2296.61719, 12.55050, 0.00000, 0.00000, 179.99451);
	CreateObject(968, 1545.73804, -2296.61328, 13.45830, 0.00000, 7.00000, 0.00000);
	CreateObject(19076, 1675.93518, -2308.02148, 13.02510, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1592.25049, -2308.60132, 13.03990, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1689.76721, -2308.02148, 13.02510, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1536.24890, -2308.83472, 12.54085, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1521.04004, -2336.43481, 12.53029, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1531.91882, -2239.16089, 12.53770, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1535.51563, -2262.22729, 12.53130, 0.00000, 0.00000, 0.00000);
	CreateObject(2232, 1687.04846, -2300.97144, 13.22910, 0.00000, 0.00000, -33.00000);
	CreateObject(2232, 1678.44849, -2300.97144, 13.22910, 0.00000, 0.00000, 33.00000);
	CreateObject(2232, 1679.30847, -2300.54150, 13.22910, 0.00000, 0.00000, 33.00000);
	CreateObject(2232, 1686.18848, -2300.54150, 13.22910, 0.00000, 0.00000, -33.00000);
	CreateObject(19076, 1682.88721, -2297.70142, 12.74310, 0.00000, 0.00000, 0.00000);
	CreateObject(19057, 1682.84546, -2298.63037, 13.29540, 0.00000, 0.00000, 0.00000);
	CreateObject(19055, 1683.98975, -2297.63647, 13.23360, 0.00000, 0.00000, 0.00000);
	CreateObject(19056, 1682.90869, -2296.55542, 13.23360, 0.00000, 0.00000, 0.00000);
	CreateObject(19058, 1681.98669, -2297.54590, 13.28230, 0.00000, 0.00000, 0.00000);
	CreateObject(3472, 1676.03125, -2295.90503, 13.59910, 0.00000, 0.00000, 0.00000);
	CreateObject(3472, 1689.51331, -2295.90503, 13.59910, 0.00000, 0.00000, 0.00000);
	CreateObject(1257, 1710.77075, -2326.66919, 13.83010, 0.00000, 0.00000, -90.00000);
	CreateObject(1341, 1702.23230, -2327.70728, 13.50940, 0.00000, 0.00000, 149.00000);
	CreateObject(1216, 1673.75500, -2326.59717, 13.18900, 0.00000, 0.00000, 90.00000);
	CreateObject(1280, 1668.28723, -2309.79810, 12.86640, 0.00000, 0.00000, 91.00000);
	CreateObject(1280, 1661.86719, -2309.79810, 12.86640, 0.00000, 0.00000, 91.00000);
	CreateObject(1432, 1686.57104, -2306.76392, 12.86180, 0.00000, 0.00000, 0.00000);
	CreateObject(1432, 1678.86694, -2306.76392, 12.86180, 0.00000, 0.00000, 40.00000);
	CreateObject(970, 1691.41064, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1710.99158, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1693.97864, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1696.86755, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1699.75659, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1702.64563, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1705.53455, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(970, 1708.42358, -2311.44507, 13.07620, 0.00000, 0.00000, 90.00000);
	CreateObject(1331, 1528.65991, -2325.57959, 13.43170, 0.00000, 0.00000, 62.00000);
	CreateObject(1415, 1528.84595, -2327.86914, 12.65750, 0.00000, 0.00000, -47.00000);
	CreateObject(19128, 1682.87793, -2297.70532, 12.53210, 0.00000, 0.00000, 0.00000);
	CreateObject(4639, 1543.82788, -2297.25269, 14.16480, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1487.35156, -2183.30029, 12.53858, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1714.85156, -2180.92944, 12.52001, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1406.67871, -2271.95386, 12.51270, 0.00000, 0.00000, 0.00000);
	CreateObject(19076, 1403.65039, -2300.68164, 12.53771, 0.00000, 0.00000, 0.00000);
	CreateObject(978, 1471.19763, -2184.30054, 13.31680, 0.00000, 0.00000, 180.00000);
	CreateObject(978, 1480.29761, -2184.30054, 13.31680, 0.00000, 0.00000, 180.00000);
	CreateObject(978, 1489.39758, -2184.30054, 13.31680, 0.00000, 0.00000, 180.00000);
	CreateObject(978, 1462.09766, -2184.30054, 13.31680, 0.00000, 0.00000, 180.00000);
	CreateObject(978, 1452.99768, -2184.30054, 13.57680, 0.00000, -3.00000, 180.00000);
	CreateObject(19076, 1469.91760, -2183.30029, 12.53860, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1708.34741, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1705.55237, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1702.67236, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1699.79236, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1696.91235, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1694.03235, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19122, 1691.35632, -2313.68164, 12.92580, 0.00000, 0.00000, 0.00000);
	CreateObject(19513, 1679.11768, -2306.68286, 13.47629, 0.00000, 0.00000, 0.00000);
	CreateObject(1258, 1664.95947, -2309.73657, 12.96240, 0.00000, 0.00000, 0.00000);
	CreateObject(627, 1681.97034, -2325.43042, 14.30170, 0.00000, 0.00000, 0.00000);
	CreateObject(627, 1689.58325, -2325.43042, 14.30170, 0.00000, 0.00000, 0.00000);
	CreateObject(11431, 1536.57166, -2247.30347, 13.81150, 0.00000, 0.00000, -90.00000);
	CreateObject(617, 1526.54370, -2316.78271, 12.26210, 0.00000, 0.00000, 0.00000);
	CreateObject(617, 1510.93311, -2336.86475, 12.54141, 0.00000, 0.00000, 0.00000);
	CreateObject(777, 1520.93262, -2237.41309, 12.53662, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1511.37219, -2235.25659, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1525.12903, -2246.93140, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1532.23401, -2269.63062, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1608.10730, -2305.60498, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1634.73022, -2306.06030, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(736, 1521.00049, -2328.18408, 23.29550, 0.00000, 0.00000, 0.00000);
	CreateObject(8041, 1553.90942, -2298.44775, 17.99670, 0.00000, 0.00000, 90.00000);
	CreateObject(8041, 1543.69946, -2274.65063, 17.99670, 0.00000, 0.00000, -90.00000);
	CreateObject(615, 1503.47437, -2303.81714, 12.31470, 0.00000, 0.00000, 0.00000);
	CreateObject(616, 1504.79419, -2288.78906, 12.53497, 0.00000, 0.00000, 0.00000);
	CreateObject(616, 1506.05493, -2273.52490, 12.53450, 0.00000, 0.00000, 0.00000);
	CreateObject(618, 1493.13733, -2315.54883, 12.53470, 0.00000, 0.00000, 0.00000);
	CreateObject(616, 1489.41724, -2255.05249, 12.53889, 0.00000, 0.00000, 0.00000);
	CreateObject(616, 1484.78638, -2166.88403, 12.54200, 0.00000, 0.00000, 0.00000);
	CreateObject(617, 1458.60962, -2165.20337, 12.53703, 0.00000, 0.00000, 0.00000);
	CreateObject(618, 1474.05542, -2162.21118, 12.53966, 0.00000, 0.00000, 0.00000);
	CreateObject(615, 1436.42712, -2169.94385, 12.53038, 0.00000, 0.00000, 0.00000);
	CreateObject(615, 1406.61169, -2165.93579, 12.51850, 0.00000, 0.00000, 0.00000);
	CreateObject(615, 1575.22351, -2348.12939, 12.53867, 0.00000, 0.00000, 0.00000);
}

forward IsVehicleOccupied(vehicleid);
public IsVehicleOccupied(vehicleid)
{
	for(new i = 0;i<MAX_PLAYERS;i++)
	{
		if(IsPlayerInVehicle(i,vehicleid)) return i;
	}
	return -1;
}

forward SpcarsAvto(playerid);
public SpcarsAvto(playerid)
{
	new string[256];
	for(new c=0; c<MAX_VEHICLES; c++)
	{
		if(IsVehicleOccupied(c) == -1) SetVehicleToRespawn(c);
	}
	format(string,sizeof(string),"{AFAFAF}[A] Администратор {ffa500}%s {AFAFAF}обновил весь незанятый транспорт!",PlayerInfo[playerid][pName]);
	SendClientMessageToAll(COLOR_GREY,string);
}

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return true;
    SetPlayerInterior(playerid, 0), SetPlayerVirtualWorld(playerid, 0);
    if (GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), fX, fY, fZ);
    else SetPlayerPos(playerid, fX, fY, fZ);
    format(string, sizeof(string), "Вы успешно телепортировались. Координаты: X - %d Y - %d Z - %d",fX, fY, fZ);
    SendClientMessage(playerid,COLOR_WHITE,string);
    return true;
}

stock IsPlayerInRangeOfPlayer(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid) && !IsPlayerNPC(playerid) && !IsPlayerNPC(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        GetPlayerPos(targetid, posx, posy, posz);
        if(IsPlayerInRangeOfPoint(playerid, radi, posx, posy, posz)) return 1;

    }
    return 0;
}
//DC_CMD Начало кмд

/*
сис-ма логов

admin = Ник-нейм администратора.
player = Игрок, над которым совершались действия. (Пример: кикнут игрок Ivan_Ivanov - записываем его)
action[] = Действия. (Пример: Kick)
amount = Значение. (Пример: Игрок Ivan_Ivanov посажен в тюрьму на 30 минут - записываем значение 30)
reason[] = Причина. (Пример: Игрок Ivan_Ivanov кикнут с причиной: "noob" - записываем "noob")
`logsadmin` = Ваша таблица для записи.
Name(admin) = Моя функция распознавания ника, можете заменить на своё.
GetIp(admin) = Моя функция распознавания IP-адреса, можете заменить на своё.
*/
CMD:mn(playerid, params[])
{
	ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "{c4f0c9}Меню Сервера", "1.Статистика Персонажа\n2.Связь с Администрацией\n3.Настройки\n4.Помощь\n5.Донат", "Выбор", "Выход");
	return 1;
}

CMD:skin(playerid, params[])
{
	new ssstring[200];
    if(PlayerInfo[playerid][pAdmin] < 2) return 1;
	if(sscanf(params,"dd", params[0], params[1])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /skin [id] [id skin]");
	if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,COLOR_GREY,"Неверный ID");
	if(params[1] > 299 || params[1] < 1) return SendClientMessage(playerid, COLOR_GREY, "ID скина от 1 до 299!");
	SetPlayerSkin(params[0], params[1]);
	format(ssstring, sizeof(ssstring), "Администратор %s[%d] поставил Вам временный скин",PlayerInfo[playerid][pName],playerid);
	SendClientMessage(params[0], COLOR_WHITE, ssstring);
	PlayerPlaySound(params[0], 1132, 0.0, 0.0, 0.0);
	return 1;
}

CMD:spcars(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(PlayerInfo[playerid][pAdmin] < 3) return 1;
		if(admloged[playerid] == 0) return 1;
		if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				SpcarsAvto(playerid);
			}
		}
	}
	return 1;
}

CMD:a(playerid, params[])
{
	if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 1) return 1;
  		if(admloged[playerid] == 0) return 1;
		if(sscanf(params,"s", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /a [сообщение]");
		new string[228];
		new sendername[MAX_PLAYER_NAME];
 		GetPlayerName(playerid, sendername, sizeof(sendername));
  		format(string, sizeof(string), "{FF0000}[ADMIN-CHAT] %s[%d]: %s",sendername, playerid, params[0]);
   		if (PlayerInfo[playerid][pAdmin] >= 1)
    	{
	    	if(IsIpFound(params[0]))
			{
   				printf("Admin %s: %s", sendername, params[0]);
				new poc[228];
				format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
				ABroadCast(COLOR_LIGHTRED,poc,1);
	   			SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
				PlayerInfo[playerid][pAdmin] = 0;
				Kick(playerid);
			}
			else
			{SendAdminMessage(COLOR_WHITE, string);}
   		}
		return 1;
	}
 	return 1;
}

CMD:msg(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 3) return 1;
  		if(admloged[playerid] == 0) return 1;
    	new string[128];
    	if(PlayerInfo[playerid][pAdmin] < 3) return 1;
		if(sscanf(params,"s", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /msg [Текст]");
		if(IsIpFound(params[0]))
		{
   			printf("Admin %s: %s", PlayerInfo[playerid][pName], params[0]);
			new poc[228];
			format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
			ABroadCast(COLOR_LIGHTRED,poc,1);
	   		SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
			PlayerInfo[playerid][pAdmin] = 0;
			Kick(playerid);
		}
		else
		{
			format(string, 130, "Администратор %s[%d]: %s", PlayerInfo[playerid][pName],playerid, params[0]);
			SendClientMessageToAll(0xFFCD00ff, string);
		}
	}
	return 1;
}

CMD:admins(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 1) return 1;
  		if(admloged[playerid] == 0) return 1;
    	SendClientMessage(playerid,COLOR_BLUE,"Администраторы онлайн:");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
			if(!IsPlayerConnected(i) || !PlayerInfo[i][pAdmin]) continue;
			new mes[64]; format(mes,sizeof(mes),"{FFFFFF}%s[%d] | Уровень: %d",PlayerInfo[i][pName],i,PlayerInfo[i][pAdmin]);
			if(PlayerAFK[i][AFK_Time] >= 5) format(mes,sizeof(mes), "%s {ffa800}[AFK: %s]", mes,Converts(PlayerAFK[i][AFK_Time]));
			SendClientMessage(playerid,COLOR_YELLOW,mes);
		}
	}
	return 1;
}

CMD:slap(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(PlayerInfo[playerid][pAdmin] < 2) return 1;
 		if(admloged[playerid] == 0) return 1;
		if(sscanf(params,"d", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /slap [ID]");
		new string[64];
		new Float:slx, Float:sly, Float:slz;
		GetPlayerPos(params[0], slx, sly, slz);
		SetPlayerPos(params[0], slx, sly, slz+8);
 		PlayerPlaySound(params[0], 1130, slx, sly, slz+5);
		format(string, sizeof(string), "[A] %s подкинул игрока %s",PlayerInfo[playerid][pName], PlayerInfo[params[0]][pName]);
		ABroadCast(COLOR_GREY,string,1);
	}
	return 1;
}

CMD:car(playerid, params[])
{
	if(sscanf(params, "ddd", params[0],params[1],params[2]))return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /car [Car ID] [Color 1] [Color 2]");
    if(params[0] < 400 || params[1] > 611)return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: ID Транспорта должен быть не меньше 400 и не больше 611");
	if(params[1] < 0 || params[1] > 126)return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: Цвет (1) Должен быть не меньше 0 и не больше 126");
	if(params[2] < 0 || params[2] > 126)return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: Цвет (2) Должен быть не меньше 0 и не больше 126");
	new Float:X,Float:Y,Float:Z,string[128];
	GetPlayerPos(playerid, X,Y,Z);
	createdvehs ++;
	createdvehicles[createdvehs] = CreateVehicle(params[0], X,Y,Z, 0.0, params[1], params[2], 300);
	PutPlayerInVehicle(playerid, createdvehicles[createdvehs], 0);
	CreatedCars[CreatedCar] = createdvehicles[createdvehs];
	LinkVehicleToInterior(createdvehicles[createdvehs], GetPlayerInterior(playerid));
	format(string, sizeof(string), "{FFFF00}• [Подсказка]: Автомобиль ID: %d создан, для удаления: /dcar", params[0]);
	SendClientMessage(playerid, -1, string);
	format(string, sizeof(string), "[A] Администратор %s[%d] сделал транспорт [vehID: %d]",PlayerInfo[playerid][pName],playerid,params[0]);
	ABroadCast(COLOR_GREY, string,1);
	return 1;
}

CMD:dcar(playerid, params[])
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		DestroyVehicle(GetPlayerVehicleID(playerid));
		SendClientMessage(playerid, -1, "{228B22}• [Успешно]: {ffffff}Автомобиль успешно удален!");
		createdvehs --;
	}
	else SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: Вы должны сидеть в транспорте");
	return true;
}

CMD:ban(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 3) return 1;
  		if(admloged[playerid] == 0) return 1;
		new string[144],id,days,unbandate2;
    	if(sscanf(params, "dds", id, days, params[3]))return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /ban [ID] [Days] [Reason]");
    	if(IsIpFound(params[0]))
		{
   			printf("Admin %s: %s", PlayerInfo[playerid][pName], params[0]);
			new poc[228];
			format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
			ABroadCast(COLOR_LIGHTRED,poc,1);
	   		SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
			PlayerInfo[playerid][pAdmin] = 0;
			Kick(playerid);
		}
		else
		{
			if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{FFFF00}• [Ошибка]: Данный ID не найден");
			if(days > 30 || days < 1) return SendClientMessage(playerid, -1, "{FFFF00}• [Ошибка]: Количество дней от 1 до 30");
			unbandate2 = gettime() + days*86400;
			format(querybans, sizeof(querybans), "INSERT INTO `Bans` (`Name`, `UnbanDate`, `Reason`) VALUES ('%s', '%d', '%s')",GetName(id), unbandate2, params[3]);
			mysql_function_query(1, querybans, false, "","");
			format(string, sizeof(string), "Администратор %s забанил игрока %s на %d дней. Причина: %s",GetName(playerid), GetName(id), days, params[3]);
			SendClientMessageToAll(0xFF4500AA, string);
			Kick(id);
			Adminlog(playerid, id, "ban", days, params[3]);
		}
	}
	return true;
}

CMD:unban(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 3) return 1;
  		if(admloged[playerid] == 0) return 1;
  		if(sscanf(params, "s[24]", params[0]))return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /unban [NickName]");
		format(querybans,sizeof(querybans),"SELECT * FROM Bans WHERE Name = '%s'", params[0]);
		mysql_function_query(1, querybans, true, "Unban", "ds",playerid, params[0]);
		Adminlog(playerid, params[0], "unban", 0, "unban");
	}
	return true;
}


CMD:ahelp(playerid, params[])
{
	if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(PlayerInfo[playerid][pAdmin] < 1) return 1;
 		if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] >= 1)SendClientMessage(playerid, COLOR_GRAD1, "{20A9FF}Доступные команды администратора:");
		if(PlayerInfo[playerid][pAdmin] >= 1)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[1 Уровень] {a7e155}/a | /kick | /cc | /ans");
		if(PlayerInfo[playerid][pAdmin] >= 1)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[1 Уровень] {a7e155}/admins | /apanel |");
		if(PlayerInfo[playerid][pAdmin] >= 2)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[2 Уровень] {a7e155}/goto | /gethere | /gm | /skin | /jail");
		if(PlayerInfo[playerid][pAdmin] >= 2)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[2 Уровень] {a7e155}/slap | /car | /dcar | */unjail");
		if(PlayerInfo[playerid][pAdmin] >= 3)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[3 Уровень] {a7e155}/spcars | /msg | /skick | /ban");
        if(PlayerInfo[playerid][pAdmin] >= 3)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[3 Уровень] {a7e155}*/unban |");
		if(PlayerInfo[playerid][pAdmin] >= 4)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[4 Уровень] {a7e155}/reloadbans | /delacc");
        if(PlayerInfo[playerid][pAdmin] >= 4)SendClientMessage(playerid, COLOR_GRAD1, "{c4f0c9}[5 Уровень] {a7e155}/newadmin |");
	}
	else return 1;
 	return 1;
}

CMD:newadmin(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(PlayerInfo[playerid][pAdmin] < 5) return 1;
 		if(admloged[playerid] == 0) return 1;
    	new string[128],gPlayername[MAX_PLAYER_NAME];
		if(sscanf(params, "ud", params[0],params[1]))return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /newadmin [playerid] [LVL]");
		if(PlayerInfo[playerid][pAdmin] == 5 && params[1] > 4 || PlayerInfo[playerid][pAdmin] == 5 && params[1] < 0)return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /newadmin [playerid] [LVL]");
		GetPlayerName(params[0], gPlayername, sizeof(gPlayername));
		if(params[1] == 0)
		{
	    	if(PlayerInfo[params[0]][pAdmin] == 0)return SendClientMessage(playerid, -1,"[Ошибка]: Игрок не администратор!");
			format(string, sizeof(string),"Администратор %s снял Вас с поста модератора",PlayerInfo[playerid][pName]);
			SendClientMessage(params[0],COLOR_RED,string);
			format(string, sizeof(string), "Вы сняли %s с поста модератора",gPlayername);
			SendClientMessage(playerid, COLOR_GREY,string);
			format(string, sizeof(string), "[A] Игрок %s был снял с поста модератора",gPlayername);
			ABroadCast(COLOR_GREY,string,1);
		}
		else
		{
			format(string, sizeof(string),"Администратор %s установил Вам права модератора %d уровня",PlayerInfo[playerid][pName],params[1]);
			SendClientMessage(params[0],COLOR_RED,string);
			format(string, sizeof(string),"Вы установили %s модераторский уровень: %d",gPlayername,params[1]);
			SendClientMessage(playerid,COLOR_RED,string);
			format(string, sizeof(string),"[A] Игрок %s был изменен в ранге администратора",gPlayername);
			ABroadCast(COLOR_GREY,string,1);
		}
		PlayerInfo[params[0]][pAdmin] = params[1];
		Save(params[0]);
	}
	return true;
}

CMD:jail(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 2) return 1;
  		if(admloged[playerid] == 0) return 1;
  		new string[144],string2[200],gPlayername[MAX_PLAYER_NAME];
		if(sscanf(params, "uds[100]", params[0],params[1],params[2]))return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /jail [ID] [Time] [Reason]");
 		if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid, -1, "{FFFF00}• [Ошибка]: Данный ID не найден");
		if(PlayerInfo[params[0]][pJailed] == 1)return SendClientMessage(playerid, -1, "{FFFF00}• [Ошибка]: Данный игрок уже в тюрьме");
    	if(params[1] > 180 || params[1] < 1)return SendClientMessage(playerid, -1, "{FFFF00}• [Ошибка]: Количество минут не более 180 (трех часов)");
		GetPlayerName(params[0], gPlayername, sizeof(gPlayername));
		if(IsIpFound(params[0]))
		{
   			printf("Admin %s: %s", PlayerInfo[playerid][pName], params[0]);
			new poc[228];
			format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
			ABroadCast(COLOR_LIGHTRED,poc,1);
	   		SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
			PlayerInfo[playerid][pAdmin] = 0;
			Kick(playerid);
		}
		else
		{
			format(string, sizeof(string), "[A] Администратор %s[%d] посадил в тюрьму игрока %s на %d минут. (Причина: %s) ",PlayerInfo[playerid][pName],playerid,PlayerInfo[params[0]][pName],params[1],params[2]);
			ABroadCast(COLOR_GREY, string,1);
			format(string2, sizeof(string2), "Вы были посажены в тюрьму администратором %s. (Причина: %s)", PlayerInfo[playerid][pName], params[2]);
			SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: Количество минут оставшихся до выхода вы можете посмотреть с помощью команды (/time)");
			SendClientMessage(playerid, COLOR_GREY, string2);
			PlayerInfo[params[0]][pJailed] = 1;
			PlayerInfo[params[0]][pJailTime] = params[1]*60;
			Save(params[0]);
			SpawnPlayer(params[0]);
			Adminlog(playerid, params[0], "jail", params[1], params[2]);
		}
	}
	return true;
}

CMD:unjail(playerid,params[])
{
	if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 3) return 1;
  		if(admloged[playerid] == 0) return 1;
    	new string[144],gPlayername[MAX_PLAYER_NAME];
		if(sscanf(params, "u", params[0]))return SendClientMessage(playerid, COLOR_GREY, "Используйте: /unjail [playerid]");
		if(!IsPlayerConnected(params[0]))return SendClientMessage(playerid,COLOR_GREY,"[Сервер]: Игрок не найден");
		if(PlayerInfo[params[0]][pJailed] == 0)return SendClientMessage(playerid,COLOR_GREY,"Игрок не сидит в тюрьме");
    	GetPlayerName(params[0], gPlayername, sizeof(gPlayername));

		format(string, sizeof(string), "[A] Администратор %s[%d] выпустил игрока %s из тюрьмы",PlayerInfo[playerid][pName],playerid,PlayerInfo[params[0]][pName]);
		ABroadCast(COLOR_GREY, string,1);
		SendClientMessage(params[0],COLOR_GREY,"{228B22}• [Успешно]: {ffffff} вы были выпущены из тюрьмы");
		PlayerInfo[params[0]][pJailed] = 0;
		PlayerInfo[params[0]][pJailTime] = 0;
		Save(params[0]);
		SpawnPlayer(params[0]);
	}
	return true;
}

CMD:delacc(playerid, params[])
{
	if(PlayerInfo[playerid][pLogged] == 1)
	{
		new rows;
		if(PlayerInfo[playerid][pAdmin] < 4) return 1;
  		if(admloged[playerid] == 0) return 1;
		new ssss[256];
		if(sscanf(params,"s", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /delacc [Nick_Name]");
		if(GetPlayerID(params[0]) != -1)
		{
 			SendClientMessage(GetPlayerID(params[0]), 0xfb4d00FF,"Ваш аккаунт был удалён за нарушение правил сервера");
			Kick(GetPlayerID(params[0]));
		}
		if(!rows) // Если в бд строки не найдены
		{
			SendClientMessage(playerid,COLOR_GREY,"Игрока с данным ник-неймом нет в базе данных");
		}
		else
		{
		    format(asd, sizeof(asd), "DELETE FROM `accountss` WHERE `Name` = '%s'", params[0]);
			mysql_function_query(MYSQL_ARG, asd, false, "", "");
			format(ssss,sizeof(ssss),"Администратор %s удалил аккаунт %s",PlayerInfo[playerid][pName], params[0]);
			ABroadCast(COLOR_RED,ssss,1);
			Adminlog(playerid, params[0], "delacc", 0, params[0]);
		}
	}
	return 1;
}

CMD:skick(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(PlayerInfo[playerid][pAdmin] < 3) return 1;
  		if(admloged[playerid] == 0) return 1;
		if(sscanf(params,"d", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /skikck [ID]");
		new id = params[0];
		if(!IsPlayerConnected(id) || IsKicked(id)) return SendClientMessage(playerid,COLOR_GREY,"Неверный ID");
		new mes[128];
		new nick[24];
		GetPlayerName(id,nick,24);
		format(mes,sizeof(mes),"[A] %s кикнул игрока %s. Тихим киком.",PlayerInfo[playerid][pName],nick);
		ABroadCast(COLOR_GREY,mes,1);
		Kick(id);
	}
	return 1;
}

CMD:goto(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
 		if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] < 2) return 1;
		if(sscanf(params,"d", params[0])) return SendClientMessage(playerid, -1, "{FFFF00}• [Подсказка]: /goto [ID игрока]");
		new id = params[0];
		if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Неверный ID");
		new Float:plocx,Float:plocy,Float:plocz;
		GetPlayerPos(id, plocx, plocy, plocz);
		SetPlayerPos(playerid,plocx,plocy+2, plocz);
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
		SetPlayerInterior(playerid, GetPlayerInterior(id));
	}
	return 1;
}

CMD:reloadbans(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
 		if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] >= 1)
  		{
			new mes[135];
			SendRconCommand("reloadbans");
			format(mes, sizeof(mes), "[A] %s[%d] перезагрузил бан-лист",PlayerInfo[playerid][pName],playerid);
			ABroadCast(COLOR_GREY,mes,1);
			SendClientMessage(playerid, 0xFFFFFFAA, "Бан лист перезагружен.");
		}
	}
	return 1;
}

CMD:gm(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
    		new sendername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(sscanf(params, "d", params[0])) return SendClientMessage(playerid,COLOR_WHITE, "{FFFF00}• [Подсказка]: /gm [id]");
			new giveplayerid = params[0];
			if (IsPlayerConnected(giveplayerid))
			{
				if (PlayerInfo[playerid][pAdmin] < 2) return 1;
				if (IsPlayerConnected(giveplayerid))
				{
					new mess[64];
					GetPlayerHealth(giveplayerid, GMHP[giveplayerid][0]);
					GetVehicleHealth(GetPlayerVehicleID(giveplayerid), VEHHP[giveplayerid][0]);
					GetPlayerArmour(giveplayerid, GMARMOUR[giveplayerid][0]);
					SetPlayerArmour(SpecAd[playerid], 0);
					SetPlayerHealth(giveplayerid, 100.0);
					player_NoCheckTimeVeh[giveplayerid] = 3;
					SetVehicleHealth(GetPlayerVehicleID(giveplayerid), 10000.0);
					SetTimerEx("GETHP", 1000, false, "i", giveplayerid);
					new Float:boomx, Float:boomy, Float:boomz;
					GetPlayerPos(giveplayerid, boomx, boomy, boomz);
					CreateExplosion(boomx, boomy , boomz+7, 5, 0.5);
					format(mess, sizeof(mess), "[A] %s проверил игрока на ГМ %s",PlayerInfo[playerid][pName]);
					ABroadCast(COLOR_GREY,mess,1);
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_RED, "");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_GRAD2, "[Ошибка] Игрок не найден!");
		}
	}
	return 1;
}

CMD:ans(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] < 1) return 1;
		if(sscanf(params, "ds", params[0],params[1])) return SendClientMessage(playerid,COLOR_WHITE, "{FFFF00}• [Подсказка]: /ans [id] [message]");
		if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,COLOR_WHITE, "Данный игрок отсутствует.");
		new pm[128];
		new pm1[125];
		new sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		GetPlayerName(params[0], giveplayer, sizeof(giveplayer));
		if(IsIpFound(params[0]))
		{
  			printf("Admin %s: %s", sendername, params[0]);
			new poc[228];
			format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
			ABroadCast(COLOR_LIGHTRED,poc,1);
   			SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
			PlayerInfo[playerid][pAdmin] = 0;
			Kick(playerid);
		}
		else
		{
			format(pm1,sizeof(pm1),"{DAA520}[ANSWER] %s[%d] ответил %s[%d]: %s",sendername,playerid,giveplayer,params[0],params[1]);
			SendAdminMessage(COLOR_WHITE, pm1);
			format(pm,sizeof(pm),"{DAA520}[Ответ] %s[%d] ответил %s[%d]: %s",sendername,playerid,giveplayer,params[0],params[1]);
			SendClientMessage(params[0], 0xDAA520AA, pm);
		}
	}
	return true;
}

CMD:gethere(playerid, params[])
{
    new string[127], ngh[100];
    if(PlayerInfo[playerid][pAdmin] < 4) return 1;
	if(sscanf(params, "d", params[0])) return SendClientMessage(playerid,COLOR_WHITE, "{FFFF00}• [Подсказка]: /gethere [id] [message]");
 	new id = params[0];
  	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "Неверный ID");
	new Float:plocx,Float:plocy,Float:plocz;
	GetPlayerPos(playerid, plocx, plocy, plocz);
	SetPlayerPos(id, plocx,plocy+2, plocz);
	SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
	SetPlayerInterior(id, GetPlayerInterior(playerid));
	format(ngh,sizeof(ngh),"Администратор %s[%d] телепортировал Вас к себе", PlayerInfo[playerid][pName], playerid);
	SendClientMessage(playerid, -1, ngh);
	format(string, 127, "[A] Администратор %s[%d] телепортировал к себе игрока %s[%d]",PlayerInfo[playerid][pName], playerid, PlayerInfo[params[0]][pName],id);
	ABroadCast(COLOR_GREY, string,1);
	return 1;
}

CMD:kick(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
			new sendername[MAX_PLAYER_NAME], paramsname[MAX_PLAYER_NAME];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			GetPlayerName(playerid, paramsname, sizeof(paramsname));
			if(PlayerInfo[playerid][pAdmin] == 0) return false;
			if(sscanf(params, "ds", params[0],params[1])) return SendClientMessage(playerid,COLOR_WHITE,"{FFFF00}• [Подсказка]: /kick [id] [причина]");
			if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,COLOR_WHITE, "Данный игрок отсутствует.");
			new kick[100];
			if(IsIpFound(params[0]))
			{
  				printf("Admin %s: %s", sendername, params[0]);
				new poc[228];
				format(poc, sizeof(poc), "[Внимание]Администратор %s[%d] был кикнут и снят с админки по причине: 'Попытка отправки IP Адресса'", PlayerInfo[playerid][pName], playerid);
				ABroadCast(COLOR_LIGHTRED,poc,1);
   				SendClientMessage(playerid, COLOR_RED,"Вы были кикнуты по подозрению в рекламе");
				PlayerInfo[playerid][pAdmin] = 0;
				Kick(playerid);
			}
			else
			{
				format(kick,100,"Администратор %s[%d] кикнул игрока %s[%d]. Причина: %s",sendername,playerid,paramsname,params[0],params[1]);
				SendClientMessageToAll(0xFF4500AA,kick);
				Kick(params[0]);
			}
		}
	}
	else return 1;
	return true;
}

CMD:cc(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
	    if(admloged[playerid] == 0) return 1;
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
 			ClearChat();
   			new string[256], name[MAX_PLAYER_NAME];
     		GetPlayerName(playerid, name, sizeof(name));
   			format(string, 100,"Администратор %s[%d] очистил чат.",name,playerid);
   			SendMessageToAll(COLOR_WHITE, string);
     		return 1;
		}
	}
	else return 1;
 	return 1;
}

CMD:ondm(playerid, params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		new str[256], sctring[200];
    	format(str,sizeof(str),"{ffffff}ДМ зона 'DM1': \t\t\t%d человек(а)\n",gapDm1);
    	strcat(sctring,str);
    	format(str,sizeof(str),"{ffffff}ДМ зона 'DM2': \t\t\t%d человек(а)\n",gapDm2);
    	strcat(sctring,str);
    	format(str,sizeof(str),"{ffffff}ДМ зона 'DM3': \t\t\t%d человек(а)\n",gapDm3);
    	strcat(sctring,str);
    	ShowPlayerDialog(playerid,999999,DIALOG_STYLE_MSGBOX,"{c4f0c9}Онлайн на Зонах",sctring,"Ок","");
	}
	return 1;
}

CMD:dm(playerid,params[])
{
    if(PlayerInfo[playerid][pJailed] == 1)return SendClientMessage(playerid,COLOR_GREY,"Нельзя заходить на зоны, когда Вы в тюрьме");
    if(PlayerInfo[playerid][pLogged] == 1)
	{
		if(sscanf(params, "d", params[0]))return SendClientMessage(playerid, COLOR_GREY, "Используйте: /dm [1-3]");
		if(params[0] < 1 || params[0] > 3)return SendClientMessage(playerid, COLOR_GREY, "Используйте: /dm [1-3]");
		if(GetPVarInt(playerid,"gMission") != 0)return SendClientMessage(playerid, COLOR_GREY, "Для начала выйдите из зоны. Команда: /exit");
		switch(params[0])
		{
	    	case 1:
			{
				SendClientMessage(playerid,-1,"{228B22}• [Успешно]: {ffffff}Вы зашли на [/dm 1]");
				SetPVarInt(playerid,"gMission",1);
				gapDm1++;
				new string[200];
				format(string, sizeof(string), "{c4f0c9}[DM Zone]: Игрок {F4A460}%s[%d] {c4f0c9}зашел на {F4A460}ДМ зону {c4f0c9}DM1", PlayerInfo[playerid][pName], playerid);
				SendClientMessageToAll(-1,string);
				ShowPlayerDialog(playerid,dg_dmGun,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #1","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
			}
			case 2:
			{
				SendClientMessage(playerid,-1,"{228B22}• [Успешно]: {ffffff}Вы зашли на [/dm 2]");
				SetPVarInt(playerid,"gMission",2);
				gapDm2++;
				new string[200];
				format(string, sizeof(string), "{c4f0c9}[DM Zone]: Игрок {F4A460}%s[%d] {c4f0c9}зашел на {F4A460}ДМ зону {c4f0c9}DM2", PlayerInfo[playerid][pName], playerid);
				SendClientMessageToAll(-1,string);
				ShowPlayerDialog(playerid,dg_dmGun,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #1","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
			}
			case 3:
			{
				SendClientMessage(playerid,-1,"{228B22}• [Успешно]: {ffffff}Вы зашли на [/dm 3]");
				SetPVarInt(playerid,"gMission",3);
				gapDm3++;
				new string[200];
				format(string, sizeof(string), "{c4f0c9}[DM Zone]: Игрок {F4A460}%s[%d] {c4f0c9}зашел на {F4A460}ДМ зону {c4f0c9}DM3", PlayerInfo[playerid][pName], playerid);
				SendClientMessageToAll(-1,string);
				ShowPlayerDialog(playerid,dg_dmGun,DIALOG_STYLE_LIST,"{c4f0c9}Выбор оружия #1","Desert Eagle\nShotGun\nMP5\nAK-47\nM4\nSniper Rifle","Выбрать","");
			}
		}
	}
	return true;
}

CMD:exit(playerid,params[])
{
    if(PlayerInfo[playerid][pLogged] == 1)
	{
    	if(GetPVarInt(playerid,"gMission") == 0)return SendClientMessage(playerid, COLOR_GREY, "Вы не находитесь на DM зоне");
		DeletePVar(playerid,"PlayerGun1");
		DeletePVar(playerid,"PlayerGun2");
		DeletePVar(playerid,"PlayerGun3");
		SpawnPlayer(playerid);
		SendClientMessage(playerid, -1, "{228B22}• [Успешно]: {ffffff}Вы вышли с зоны");
		switch(GetPVarInt(playerid,"gMission"))
		{
		    case 1: gapDm1--;
		    case 2: gapDm2--;
			case 3: gapDm3--;
		}
		SetPVarInt(playerid,"gMission",0);
	}
	return 1;
}

forward Start_R_A(playerid);
public Start_R_A(playerid)//Тут мы узнаём статус игрока(зарегистрирова или наоборот)
{
	new rows, fields;
	cache_get_data(rows, fields);
	if(rows)
	{
		new loginmsg[187];
		new name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(loginmsg,187,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {228B22}найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
		ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{c4f0c9}Авторизация",loginmsg,"Войти","Отмена");
	}
	else
	{
		new loginmsg[230];
		new name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(loginmsg,350,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {AA3333}не найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
		ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{c4f0c9}Регистрация",loginmsg,"Далее","Отмена");
	}
	return 1;
}

stock clear(playerid)
{
    skin[playerid] = false;
    AFK[playerid] = false;
    PlayerAFK[playerid][AFK_Time] = 	false;
    PlayerAFK[playerid][AFK_Stat] = 	false;
    PlayerInfo[playerid][pAdmin] = 		false;
	PlayerInfo[playerid][pDeaths] = 	false;
	PlayerInfo[playerid][pKills] = 		false;
	PlayerInfo[playerid][pLogged] = 	false;
	PlayerInfo[playerid][pJailTime] =   false;
	PlayerInfo[playerid][pJailed] =     false;
	admloged[playerid] =				false;
 	Delete3DTextLabel(AFK_3DT[playerid]);
	return 1;
}

forward Avtoriz(playerid, password[]);
public Avtoriz(playerid, password[])//Тут мы узнаём верные данные он ввёл или нет(Пароль)
{
    new rows, fields;
	cache_get_data(rows, fields);
	if(!rows)
	{
		new loginmsg[187];
		new name[MAX_PLAYER_NAME];
		GetPlayerName(playerid, name, sizeof(name));
		format(loginmsg,187,"{FFFFFF}Добро пожаловать на сервер!\nДанный аккаунт {228B22}найден {ffffff}в базе данных\n\nВаш ник: %s\n\nВаш пароль:",name);
		ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{c4f0c9}Авторизация",loginmsg,"Войти","Отмена");
		SendClientMessage(playerid,-1,"Вы ввели неверный пароль");
	  	return 1;
	}
 	PlayerInfo[playerid][pLogged] = 1;
	for(new i = 0; i < rows;i++)
	{
		Avt(i,playerid);
		SpawnPlayer(playerid);
    	SetPlayerScore(playerid,PlayerInfo[playerid][pKills]);
	}
	SpawnPlayer(playerid);
    SetPlayerScore(playerid,PlayerInfo[playerid][pKills]);
    if(PlayerInfo[playerid][pAdmin])
	{
	    SendClientMessage(playerid,COLOR_RED,"Для начала работы авторизуйтесь в админ. панеле.");
		ShowPlayerDialog(playerid, 6, DIALOG_STYLE_INPUT, "{AA3333}Авторизация", "{ffffff}Добро пожаловать на сервер, вы зашли как администратор.\nВведите пароль от админ панели:", "Вход", "Отмена");
	}
	SendClientMessage(playerid, -1, "{DCDCDC}Чтобы войти на дм зоны используйте команды {FFD700}/dm [1-3] {DCDCDC}или - же {FFD700}/deagle [1-3]");
	SendClientMessage(playerid, -1, "{DCDCDC}Так - же остальные зоны вы можете увидеть в пункте {FFD700}'Помощь' {DCDCDC}в разделе нашего меню команда ({FFD700}/mn{DCDCDC})");
    return 1;
}

stock Avt(i,playerid)
{
    PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(i, "Admin", MYSQL_ARG);
	PlayerInfo[playerid][pKills] = cache_get_field_content_int(i, "Kills", MYSQL_ARG);
	PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(i, "Deaths", MYSQL_ARG);
    cache_get_field_content(0, "IP", PlayerInfo[playerid][IP], MYSQL_ARG, 129);
    PlayerInfo[playerid][pJailed] = cache_get_field_content_int(i, "pJailed", MYSQL_ARG);
    PlayerInfo[playerid][pJailTime] = cache_get_field_content_int(i, "pJailTime", MYSQL_ARG);
}

stock Reg(playerid)
{
    new year, month, day, cdate[30], ipStr[16];
	getdate(year, month, day);
	GetPlayerIp( playerid, ipStr, 16 );
	f(cdate,"%d.%d.%d",day,month,year);
 	format(PlayerInfo[playerid][IP], 16,"%s", ipStr);
  	mysql_format(MYSQL_ARG, asd, sizeof(asd), "INSERT INTO `"Baza"` (`Name`, `Password`,`Admin`,`Kills`,`Deaths`,`IP`,`pJailed`,`pJailTime`) VALUES ('%e', '%e', '%d', '%d','%d','%s','%d','%d')",
	PlayerInfo[playerid][pName],
	PlayerInfo[playerid][pPassword],
	PlayerInfo[playerid][pAdmin],
	PlayerInfo[playerid][pKills],
	PlayerInfo[playerid][pDeaths],
	PlayerInfo[playerid][IP],
	PlayerInfo[playerid][pJailed],
	PlayerInfo[playerid][pJailTime]);
	mysql_function_query(MYSQL_ARG, asd, false, "", "");
}

stock Save(playerid)
{
  	mysql_format(MYSQL_ARG, asd, sizeof(asd),"UPDATE `"Baza"` SET `Admin` = '%d', `Kills` = '%d', `Deaths` = '%d', `IP` = '%s', `pJailed` = '%d',`pJailTime`=%d WHERE `Name` = '%e'",
	PlayerInfo[playerid][pAdmin],
	PlayerInfo[playerid][pKills],
	PlayerInfo[playerid][pDeaths],
	PlayerInfo[playerid][IP],
	PlayerInfo[playerid][pJailed],
	PlayerInfo[playerid][pJailTime],
	PlayerInfo[playerid][pName]);
	mysql_function_query(MYSQL_ARG, asd, false, "", "");
}

stock IsIpFound(const string[])
{
	if(!reklamka) reklamka= regex_build("([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})[^[:digit:]^[:cntrl:]]{1,3}([0-9]{1,3})");
	return regex_search_exid(string, reklamka);
}

stock SendAdminMessage(color, string[])
{
	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pAdmin] >= 1)
			{
				SendClientMessage(i, color, string);
			}
		}
	}
}
stock SendGodMessage(color, string[])
{
	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pAdmin] >= 1)
			{
   			 if(god[i] == 1)
   			 {
					SendClientMessage(i, color, string);
				}
			}
		}
	}
}
stock SendMessageToAll(color, string[])
{
	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(IsPlayerConnected(i))
		{
			SendClientMessage(i, color, string);
		}
	}
}
stock ClearChat()
{
    for(new j = 0; j < 100; j++)
	{
	    SendMessageToAll(COLOR_WHITE, "");
	}
	return 1;
}

stock ABroadCast(color,const string[],level)
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pAdmin] >= level) SendClientMessage(i, color, string);
		}
	}
	return true;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == Text:INVALID_TEXT_DRAW)
	{
	    if(GetPVarInt(playerid,"ShowTD") != 0) SelectTextDraw(playerid,COLOR_RED);
	    return true;
	}
    if(clickedid == StartSkin[playerid][2])
	{
	    SkinPed[playerid]++;
        if(SkinPed[playerid] >= 84) SkinPed[playerid] = 0;
        SetPlayerSkin(playerid,Skinn[SkinPed[playerid]]);
	}
	if(clickedid == StartSkin[playerid][3])
	{
	    TextDrawHideForPlayer(playerid,StartSkin[playerid][0]);
		TextDrawHideForPlayer(playerid,StartSkin[playerid][1]);
		TextDrawHideForPlayer(playerid,StartSkin[playerid][2]);
		TextDrawHideForPlayer(playerid,StartSkin[playerid][3]);
		CancelSelectTextDraw(playerid);
		DeletePVar(playerid,"ShowTD");
	    DeletePVar(playerid,"EnterSkin");
	    SetCameraBehindPlayer(playerid);
	    SetPVarInt(playerid,"startskin",GetPlayerSkin(playerid));
	    PlayerInfo[playerid][pLogged] = true;
	    skin[playerid] = true;
 		SpawnPlayer(playerid);
	}
	return true;
}

stock NewKick(playerid, reason[], color = COLOR_LIGHTRED)
{
	if(IsPlayerNPC(playerid)) return true;
    if(GetPVarInt(playerid, "kicked") == 1) return 1;
    SendClientMessage(playerid, color, reason);
    SetPVarInt(playerid, "kicked", 1);
    SetTimerEx("KickPublic", 100, false, "d", playerid);
    return 1;
}
forward KickPublic(playerid);
public KickPublic(playerid) {
    if(IsPlayerConnected(playerid)) {
		ResetPlayerWeapons(playerid);
		DeletePVar(playerid, "kicked");
	 	Kick(playerid);
	}
}

stock FP_GivePlayerWeapon(playerid,weaponid,ammo)
{
    FP_Weapon[playerid][weaponid]=1;
    return GivePlayerWeapon(playerid,weaponid,ammo);
}

stock FP_ResetPlayerWeapons(playerid)
{
    for(FP_Ammo_Weapon_i[playerid]=0;FP_Ammo_Weapon_i[playerid]<47;FP_Ammo_Weapon_i[playerid]++)
	{
            FP_Weapon[playerid][FP_Ammo_Weapon_i[playerid]]=0;
	}
 	return ResetPlayerWeapons(playerid);
}

stock FP_AddPlayerClass(Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo)
{
    FP_Classid_APC=AddPlayerClass(Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    FP_Player_Class_Weapons[FP_Classid_APC][0]=weapon1;
    FP_Player_Class_Weapons[FP_Classid_APC][1]=weapon2;
    FP_Player_Class_Weapons[FP_Classid_APC][2]=weapon3;
    return FP_Classid_APC++;
}

stock FP_AddPlayerClassEx(teamid,Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo)
{
    FP_Classid_APCE=AddPlayerClassEx(teamid,Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    FP_Player_Class_Weapons[FP_Classid_APCE][0]=weapon1;
    FP_Player_Class_Weapons[FP_Classid_APCE][1]=weapon2;
    FP_Player_Class_Weapons[FP_Classid_APCE][2]=weapon3;
    return FP_Classid_APCE++;
}

stock FP_SetSpawnInfo(playerid,team,Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo)
{
	FP_Spawn_Weapons[playerid][0]=weapon1;
 	FP_Spawn_Weapons[playerid][1]=weapon2;
  	FP_Spawn_Weapons[playerid][2]=weapon3;
    return SetSpawnInfo(playerid,team,Float:x,Float:y,Float:z,Float:Angle,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
}
