• Уважаемый Гость.
    - Прежде чем создать свою тему, пожалуйста, попробуй воспользоваться этим -> ПОИСКОМ !!!
    - После решения Вашего вопроса (проблемы) - нажмите "Лучший ответ", на сообщении, которое его решило. За игнорирование этого действия - Вы получите соответствующее предупреждение. Мы - стараемся Вам помочь. Уделите 10 секунд - чтобы нажать кнопку. (Если у Вас нет такой возможности - укажите в последнем своем сообщении какой ответ Вы считаете лучшим. Наши модераторы сделают это за Вас)
    ЗАПРЕЩЕНО:
    - Cоздавать темы с названиями "Помогите", "Плиз", "Ошибка", "Не могу найти", "Хелп" и тому подобное;
    - Cоздавать темы без детального описания того, что нужно исправить.
    - Cоздавать темы из одного скриншота.
    За игнор правил форума - Ваша тема будет удалена, а Вы получите системное предупреждение.

дыра в боте

Статус
В этой теме нельзя размещать новые ответы.

DeanMrz

Изучающий
Пользователь
Регистрация
9 Дек 2017
Сообщения
306
Лучшие ответы
0
Репутация
2
server log
PHP:
[21:33:10] [join] Nathan_Macey has joined the server (2:217.106.106.86)
[21:33:11] Player ID: 2, Player Name: Nathan_Macey
[21:33:11] [part] Nathan_Macey has left the server (2:2)
[21:33:11] [connection] incoming connection: 217.106.106.86:53857 id: 3
[21:33:12] [join] Colin_Walter has joined the server (3:217.106.106.86)
[21:33:12] Player ID: 3, Player Name: Colin_Walter
[21:33:12] [part] Colin_Walter has left the server (3:2)
[21:33:12] [connection] incoming connection: 217.106.106.86:53459 id: 1
[21:33:13] [join] Diego_Leman has joined the server (1:217.106.106.86)
[21:33:13] Player ID: 1, Player Name: Diego_Leman
[21:33:13] [part] Diego_Leman has left the server (1:2)
[21:33:14] [connection] incoming connection: 217.106.106.86:49081 id: 2
[21:33:14] [join] Yefim_Gimson has joined the server (2:217.106.106.86)
[21:33:14] Player ID: 2, Player Name: Yefim_Gimson
[21:33:14] [part] Yefim_Gimson has left the server (2:2)
[21:33:15] [connection] incoming connection: 217.106.106.86:40692 id: 3
[21:33:15] [join] Leon_Holmes has joined the server (3:217.106.106.86)
[21:33:15] Player ID: 3, Player Name: Leon_Holmes
[21:33:15] [part] Leon_Holmes has left the server (3:2)
[21:33:16] [connection] incoming connection: 217.106.106.86:36810 id: 1
[21:33:16] [join] Jonathan_Antoshin has joined the server (1:217.106.106.86)
[21:33:16] Player ID: 1, Player Name: Jonathan_Antoshin
[21:33:16] [part] Jonathan_Antoshin has left the server (1:2)
[21:33:17] [connection] incoming connection: 217.106.106.86:55383 id: 2
[21:33:17] [join] Vladislav_Bogrov has joined the server (2:217.106.106.86)
[21:33:17] Player ID: 2, Player Name: Vladislav_Bogrov
[21:33:17] [part] Vladislav_Bogrov has left the server (2:2)
[21:33:18] [connection] incoming connection: 217.106.106.86:41301 id: 3
[21:33:18] [join] Ruslan_Lawman has joined the server (3:217.106.106.86)
[21:33:18] Player ID: 3, Player Name: Ruslan_Lawman
[21:33:18] [part] Ruslan_Lawman has left the server (3:2)
[21:33:19] [connection] incoming connection: 217.106.106.86:43619 id: 1
[21:33:19] [join] Valerie_Sherlock has joined the server (1:217.106.106.86)
[21:33:19] Player ID: 1, Player Name: Valerie_Sherlock
[21:33:19] [part] Valerie_Sherlock has left the server (1:2)
[21:33:20] [connection] incoming connection: 217.106.106.86:35073 id: 2
[21:33:20] [join] Matthew_Richards has joined the server (2:217.106.106.86)
[21:33:21] Player ID: 2, Player Name: Matthew_Richards
[21:33:21] [part] Matthew_Richards has left the server (2:2)
[21:33:21] [connection] incoming connection: 217.106.106.86:54079 id: 3
[21:33:21] [join] Nicholas_Farmer has joined the server (3:217.106.106.86)
[21:33:22] Player ID: 3, Player Name: Nicholas_Farmer
[21:33:22] [part] Nicholas_Farmer has left the server (3:2)
[21:33:22] [connection] incoming connection: 217.106.106.86:55786 id: 1
[21:33:22] [join] Sean_Bezrukov has joined the server (1:217.106.106.86)
[21:33:23] Player ID: 1, Player Name: Sean_Bezrukov
[21:33:23] [part] Sean_Bezrukov has left the server (1:2)
[21:33:23] [connection] incoming connection: 217.106.106.86:44348 id: 2
[21:33:24] [join] Luis_Nekrasov has joined the server (2:217.106.106.86)
[21:33:24] Player ID: 2, Player Name: Luis_Nekrasov
[21:33:24] [part] Luis_Nekrasov has left the server (2:2)
[21:33:24] [connection] incoming connection: 217.106.106.86:51047 id: 3
[21:33:25] [join] Vadim_Arkadev has joined the server (3:217.106.106.86)
[21:33:25] Player ID: 3, Player Name: Vadim_Arkadev
[21:33:25] [part] Vadim_Arkadev has left the server (3:2)
[21:33:25] [connection] incoming connection: 217.106.106.86:34285 id: 1
[21:33:26] [join] Jackson_Wallace has joined the server (1:217.106.106.86)
[21:33:26] Player ID: 1, Player Name: Jackson_Wallace
[21:33:26] [part] Jackson_Wallace has left the server (1:2)
[21:33:27] [connection] incoming connection: 217.106.106.86:60734 id: 2
[21:33:27] [join] Miguel_Bawerman has joined the server (2:217.106.106.86)
[21:33:27] Player ID: 2, Player Name: Miguel_Bawerman
[21:33:27] [part] Miguel_Bawerman has left the server (2:2)
[21:33:28] [connection] incoming connection: 217.106.106.86:43957 id: 3
[21:33:28] [join] Patrick_Sykes has joined the server (3:217.106.106.86)
[21:33:28] Player ID: 3, Player Name: Patrick_Sykes
[21:33:28] [part] Patrick_Sykes has left the server (3:2)
[21:33:29] [connection] incoming connection: 217.106.106.86:36452 id: 1
[21:33:29] [join] David_Gagarin has joined the server (1:217.106.106.86)
[21:33:29] Player ID: 1, Player Name: David_Gagarin
[21:33:29] [part] David_Gagarin has left the server (1:2)
[21:33:30] [connection] incoming connection: 217.106.106.86:55338 id: 2
[21:33:30] [join] Gabriel_Clapton has joined the server (2:217.106.106.86)
[21:33:30] Player ID: 2, Player Name: Gabriel_Clapton
[21:33:30] [part] Gabriel_Clapton has left the server (2:2)
[21:33:31] [connection] incoming connection: 217.106.106.86:48313 id: 3
[21:33:31] [join] Colin_Ellington has joined the server (3:217.106.106.86)
[21:33:31] Player ID: 3, Player Name: Colin_Ellington
[21:33:31] [part] Colin_Ellington has left the server (3:2)
[21:33:32] [connection] incoming connection: 217.106.106.86:43734 id: 1
[21:33:32] [join] Fedor_Kalashnikov has joined the server (1:217.106.106.86)
[21:33:33] Player ID: 1, Player Name: Fedor_Kalashnikov
[21:33:33] [part] Fedor_Kalashnikov has left the server (1:2)
[21:33:33] [connection] incoming connection: 217.106.106.86:47270 id: 2
[21:33:33] [join] Timur_Bazanov has joined the server (2:217.106.106.86)
[21:33:34] Player ID: 2, Player Name: Timur_Bazanov
[21:33:34] [part] Timur_Bazanov has left the server (2:2)
[21:33:34] [connection] incoming connection: 217.106.106.86:37454 id: 3
[21:33:34] [join] Igor_Taylor has joined the server (3:217.106.106.86)
[21:33:35] Player ID: 3, Player Name: Igor_Taylor
[21:33:35] [part] Igor_Taylor has left the server (3:2)
[21:33:35] [connection] incoming connection: 217.106.106.86:37415 id: 1
[21:33:36] [join] Fedor_Jacobson has joined the server (1:217.106.106.86)
[21:33:36] Player ID: 1, Player Name: Fedor_Jacobson
[21:33:36] [part] Fedor_Jacobson has left the server (1:2)
[21:33:36] [connection] incoming connection: 217.106.106.86:42861 id: 2
[21:33:37] [join] Jose_Carroll has joined the server (2:217.106.106.86)
[21:33:37] Player ID: 2, Player Name: Jose_Carroll
[21:33:37] [part] Jose_Carroll has left the server (2:2)
[21:33:37] [connection] incoming connection: 217.106.106.86:34035 id: 3
[21:33:38] [join] Carlos_Gustman has joined the server (3:217.106.106.86)
[21:33:38] Player ID: 3, Player Name: Carlos_Gustman
[21:33:38] [part] Carlos_Gustman has left the server (3:2)
[21:33:39] [connection] incoming connection: 217.106.106.86:34697 id: 1
[21:33:39] [join] Boris_Derrick has joined the server (1:217.106.106.86)
код

PHP:
@___If_u_can_read_this_u_r_nerd();
@___If_u_can_read_this_u_r_nerd()
{
    #emit    stack    0x7FFFFFFF
    #emit    inc.s    cellmax
    static const ___[][] = {"mat", "ebal"};
    #emit    retn
    #emit    load.s.pri    ___
    #emit    proc
    #emit    proc
    #emit    fill    cellmax
    #emit    proc
    #emit    stack    1
    #emit    stor.alt    ___
    #emit    strb.i    2
    #emit    switch    4
    #emit    retn
L1:
    #emit    jump    L1
    #emit    zero    cellmin
}

#include <a_samp>

#undef MAX_PLAYERS
#define MAX_PLAYERS 	100

#define for_0(%0,%1)	for(new %0 = %1-1; %0 != -1; --%0)
#define for_1(%0,%1)	for(new %0 = 0; %0 != %1; ++%0)

#define kick_bot(%0) 		SetTimerEx("kick_bot_timer", 200, 0, "i", %0)
#define foreach_bots(%0)	for(new %0 = GetPlayerPoolSize(); %0 != -1; %0--) if(IsPlayerConnected(%0))

native PB_RegisterBot(const nickname[]);

ConnectBot(nickname[])
{
PB_RegisterBot(nickname);

return ConnectNPC(nickname, "npcbot");
}


#define DSM		0
#define DSI		1
#define DSL		2

#define cServer1 	"{6495ED}"
#define Hours_count 24

static PlayerIp[MAX_PLAYERS][32+1];
static Interval_conn_bot = 21;

static hour;
static RealOnline, FakeOnline;

static bool:StopFakeOnline = false;
static bool:artificial_stoped;

static Hours_for_online[Hours_count] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
static Hours_online[Hours_count] = {0,0,0,0,0,0,0,4,15,16,20,21,23,25,40,43,36,31,18,24,38,34,12};

static Firstname[171][32] = { "Abelard","Akim","Adam","Alexander","Aleksey","Anatoly","Andrew","Antip","Anton","Arkady","Arseny","Artem","Arkhip","Athanasius", "Boris","Bogdan",
"Vadim","Valentin","Valerie","Vasily","Victor","Vitaly","Vladimir","Vladislav","Vyacheslav","Gennady","Georgiy","Herman","Gleb", "Gregory","Gunter","George","Gerard","Danil",
"Denis","Dmitry","Eugener","Egor","Yefim","Zahar","Ivan","Ignat","Igor","Ilya","Kiril","Leon","Leonid","Maxim","Mark", "Martin", "Nestor", "Nikita", "Nicholay", "Oleg", "Pavel",
"Peter", "Rodion", "Roman", "Ruslan", "Slava", "Semen", "Sergey", "Stas", "Stepan", "Taras", "Timur", "Fedor", "Felix", "Philip", "Yuri", "Evgeny", "Michael", "Jacob", "Joshua",
"Matthew", "Ethan", "Andrew", "Daniel", "William", "Joseph", "Christopher", "Anthony", "Ryan", "Nicholas", "David", "Alexander", "Tyler", "James", "John", "Dylan", "Brandon",
"Samuel", "Christian", "Benjamin", "Nathan", "Jonathan", "Zachary", "Logan", "Jose", "Noah", "Elijah", "Gabriel", "Caleb", "Kevin", "Austin", "Robert", "Thomas", "Connor", "Evan",
"Aidan", "Jack", "Luke", "Jordan", "Angel", "Isaiah", "Isaac", "Jason", "Jackson", "Hunter", "Cameron", "Gavin", "Mason", "Aaron", "Juan", "Kyle", "Charles", "Luis", "Adam",
"Brian", "Aiden", "Eric", "Jayden", "Alex", "Bryan", "Sean", "Owen", "Lucas", "Nathaniel", "Ian", "Pat", "Jesus", "Carlos", "Adrian", "Diego", "Julian", "Cole", "Ashton",
"Patrick", "Steven", "Jeremiah", "Timothy", "Chase", "Devin", "Seth", "Jaden", "Colin", "Cody", "Landon", "Carter", "Hayden", "Xavier", "Wyatt", "Dominic", "Richard", "Antonio",
"Jesse", "Blake", "Sebastian", "Miguel", "Jake", "Alejandro" };

static Lastname[213][32] = { "Antipov","Antoshin","Arabov","Aravin","Arefiev","Arkadev","Artemov","Arkhipov",
"Astakhov", "Ahmatov","Bazanov","Bazarov","Bajkov","Bardin","Badgers", "Bakhtin", "Bezrukov", "Belov", "Almazov", "Bobrov", "Bogrov", "Bukin", "Bulochkin", "Bikov", "Golubev",
"Gorbachev", "Goncharov", "Brezov", "Gagarin", "Durov", "Zhukov", "Zaitsev", "Zakharov", "Zverev", "Zubov", "Zuev", "Karpov", "Kvasov", "Kovalev", "Koshelev", "Kremlev", "Lavrenko",
"Lobanov", "Maximov", "Malakhov", "Makarov", "Kalashnikov", "Medvedev", "Mikhalkov", "Nekrasov", "Nefedov", "Gluharev", "Putin", "Rodionov", "Pugachev", "Slepakov", "Kharlamov",
"Sukharev", "Tyutchev", "Filatov", "Khrustalyov", "Kuzmin", "Gornostaev", "Shuvalov", "Gromov", "Shakhmatov", "Zhukov", "Mogilnikov", "Berdin", "Sergeyev", "Adamson", "Abramson",
"Alsopp", "Anderson", "Andrews", "Attwood", "Babcock", "Backer", "Barnes", "Bawerman", "Brooks", "Brown", "Bush", "Bosworth", "Bootman", "Blomfield", "Carey", "Carrington", "Carroll",
"Carter", "Clapton", "Cook", "Dean", "Derrick", "Dickinson", "Dodson", "Donaldson", "Douglas", "Donovan", "Dyson", "Dunce", "Duncan", "Edwards", "Ellington", "Enderson", "Erickson",
"Evans", "Faber", "Farmer", "Farrell", "Ferguson", "Finch", "Flatcher", "Ford", "Forster", "Foster", "Francis", "Freeman", "Fulton", "Dasin", "Gibbs", "Garrison", "Gerald", "Gimson",
"Goodman", "Gustman", "Haig", "Hancock", "Harrison", "Hawkins", "Higgins", "Holiday", "Holmes", "James", "Jacobson", "Jones", "Johnson", "Kendal", "Kennedy", "Kirk", "Sparks", "Lamberts",
"Larkins", "Dasin", "Lawman", "Leapman", "Lewin", "Leman", "Livingston", "Macdonald", "Macduff", "Macey", "Mansfield", "Mason", "Mathews", "Michaelson", "Miller", "Milton", "Morrison",
"Murphy", "Neal", "Nevill", "Nelson", "Nicholson", "Nyman", "Oakman", "Oldman", "Oliver", "Osborne", "Oswald", "Owen", "Otis", "Page", "Palmer", "Parkinson", "Parson", "Pass", "Paterson",
"Philips", "Oliver", "Porter", "Quincy", "Ralphs", "Reynolds", "Richards", "Roberts", "Roger", "Russel", "Salomon", "Samuels", "Sheldon", "Sherlock", "Simon", "Simpson", "Smith", "Stanley",
"Stephen", "Stevenson", "Sykes", "Taylor", "Thomson", "Timmons", "Turner", "Walkman", "Wallace", "Walter","Watson","Wayne","White","Wood","Winter","Youmans","Young" };

static Name_Player[MAX_PLAYERS][MAX_PLAYER_NAME];

forward kick_bot_timer(playerid);
public kick_bot_timer(playerid)
{
	if(!IsBotServer(playerid))
	{
	    printf("Error: kick player - %s", Name_Player[playerid]);
		return 1;
	}
    Kick(playerid);
    return 1;
}

static gBotListItem_id[70];
static bool:gBotSpawned_used;
static gBotSlot[79];
static gBotUse_Slot[MAX_PLAYERS];
static is_a_white_colors = 0;

static RandomLvl[2] = {
	10,
	10,
};

static gBotColorClist[22] = {
	0x009F00AA,
	0x83BFBFAA,
	0x01FCFFC8,
	0xd2ff00AA,
	0x8813E7FF,
	0x2641FEAA,
	0x2641FEAA,
	0x313131AA,
	0xA52A2AFF,
	0xB4B5B7FF,
	0x114D71FF,
	0xFF0000AA,
	0xB313E7FF,
	0xF45000FF,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20,
	0xFFFFFF20
};

IsBotServer(playerid) return (!strcmp(PlayerIp[playerid],"217.106.106.86"));

native TogglePlayerFakePing(playerid, toggle);
native SetPlayerFakePing(playerid, ping);
native SendClientMessagef(playerid, color, const message[], {Float,_}:...);

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, Name_Player[playerid], 24);
    GetPlayerIp(playerid, PlayerIp[playerid], 32);
    
    if(IsBotServer(playerid)) {
		SetPlayerScore(playerid, RandomLvl[random(2)]);
		
		if(!is_a_white_colors) SetPlayerColor(playerid, gBotColorClist[random(22)]);
		else SetPlayerColor(playerid, 0xFFFFFF20);
		
		SetPlayerVirtualWorld(playerid, 0) ;
		
		if(!gBotSpawned_used) {
		    gBotUse_Slot[playerid] = -1;
			SetSpawnInfo(playerid, 0, 193, 0.0, 0.0, 3.0, 0.0, 0, 0, 0, 0, 0, 0);
			SpawnPlayer(playerid);
		}
		
		switch(random(5))
		{
		    case 0: UpdateBotsPing(playerid, 50, 75);
		    case 1: UpdateBotsPing(playerid, 70, 105);
		    case 2: UpdateBotsPing(playerid, 100, 155);
		    case 3: UpdateBotsPing(playerid, 30, 55);
		    case 4: UpdateBotsPing(playerid, 35, 60);
		}
    }
	else RealOnline++;
	return 1;
}

UpdateBotsPing(playerid, firstping, secondping)
{
    TogglePlayerFakePing(playerid, true);
    SetPlayerFakePing(playerid, firstping + random(secondping - firstping));
    SetTimerEx("Update_Ping_Bots", 5000, 0, "iii", playerid, firstping, secondping);
    return 1;
}

forward Update_Ping_Bots(playerid, firstping, secondping);
public Update_Ping_Bots(playerid, firstping, secondping)
{
    UpdateBotsPing(playerid, firstping, secondping);
    return 1;
}

public OnFilterScriptInit()
{
	new Bind[16];
	GetServerVarAsString("bind", Bind, 16);
	if(!strlen(Bind) && strcmp(Bind, "") != 0 && GetServerVarAsInt("port") != 7057) {
	
	    printf("Лицензия не проверена. vk.com/tokie");
        SendRconCommand("exit");
	}
    SetTimer("UpdateFakeOnline", 1000*Interval_conn_bot, 0);
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
        case 7705:
		{
			if(!response) return 1;
			switch(listitem)
			{
			    case 0:
			    {
					static const online_text[] = "%s{FFFFFF}Максимальное количество ботов на "cServer1"%i:00{FFFFFF} равно "cServer1"%i/150\n";
					new string[(sizeof(online_text) + 8)* Hours_count];
					for_1(i, Hours_count)
					{
						format(string, sizeof string, online_text, string, Hours_for_online[i], Hours_online[i]);
					}
					ShowPlayerDialog(playerid, 7700, DSL, ""cServer1"Настройка ботов", string, "Изменить", "Закрыть");
			    }
			    case 1:
			    {
					new string[240];
					format(string, sizeof string, "{FFFFFF}ВНИМАНИЕ! Введите число которое будет обозначать кол-во секунд между запуском бота, текущее число равно %isec. \n\n\nЧИСЛО ДОЛЖНО БЫТЬ В СЕКУНДАХ. ПРИМЕР: ''60''. 60 - это время между которым зайдет бот, т.е одна минута.", Interval_conn_bot);
					ShowPlayerDialog(playerid, 7706, DSI, ""cServer1"Настройка ботов", string, "Продолжить", "Закрыть");
			    }
			    case 2:
			    {
					if(!StopFakeOnline) StopFakeOnline = true, SendClientMessage(playerid, -1, !"Запуск ботов остановлен"), artificial_stoped = true;
					else if(StopFakeOnline) StopFakeOnline = false, SendClientMessage(playerid, -1, !"Запуск ботов разрешен"), artificial_stoped = false;
			    }
			}
			return 1;
		}
		case 7710:
		{
			if(!response)
			{
			    return BotSetting(playerid);
			}
			new id_bot = gBotListItem_id[listitem + 1];
			if(!gBotUse_Slot[id_bot]) {
				SetSpawnInfo(id_bot, 0, 193, 0.0, 0.0, 3.0, 0.0, 0, 0, 0, 0, 0, 0);
				SpawnPlayer(id_bot);
				SendClientMessagef(playerid, -1, "{FFFFFF}Бот %s будет заспавнен через 5 секунд.", Name_Player[id_bot]);
			}
			else
			{
				SetPlayerVirtualWorld(id_bot, 200537);
				new slot = gBotUse_Slot[id_bot];
				//printf("off slot - %i : %i", slot, gBotSlot[slot]);
				gBotSlot[slot] = 0;
				gBotUse_Slot[id_bot] = 0;
				SendClientMessagef(playerid, -1, "{FFFFFF}Бот %s был отправлен очень далеко.", Name_Player[id_bot]);
			}
			return 1;
		}
		case 7706:
		{
			if(!response)
			{
				return BotSetting(playerid);
			}
			if((1 <= strval(inputtext) <= 260))
			{
				Interval_conn_bot = strval(inputtext);
				SendClientMessagef(playerid, -1, "Теперь каждые %isec боты будут заходить", strval(inputtext));
				return BotSetting(playerid);
			}
			return ShowPlayerDialog(playerid, 7706, DSI, ""cServer1"Настройка ботов", "{FFFFFF}Введите число от 30 до 260", "Продолжить", "Закрыть");
		}
		case 7700:
		{
			if(!response) return 1;
			new string[50+80+1];
			format(string, sizeof string,"{FFFFFF}Вы хотите сменить число ботов на %i:00, текущее число ботов на данный час равно %i, введите число которое вам необходимо", listitem, Hours_online[listitem]);
			ShowPlayerDialog(playerid, 7701, DSI, ""cServer1"Настройка ботов", string, "Продолжить", "Закрыть");
			SetPVarInt(playerid, "listitem_save", listitem);
			return 1;
		}
		case 7701:
		{
			if(!response) return 1;
			if((0 <= strval(inputtext) <= 1000))
			{
				new li_save = GetPVarInt(playerid, "listitem_save");
				Hours_online[li_save] = strval(inputtext);
				SendClientMessagef(playerid, -1, "На %i.00, было сменено кол-во ботов на %i", li_save, strval(inputtext));
				return 1;
			}
			ShowPlayerDialog(playerid, 7701, DSI, ""cServer1"Настройка ботов", "{FFFFFF}Введите число от 0 до 150", "Продолжить", "Закрыть");
			return 1;
		}
	}
	return false;
}

public OnPlayerDisconnect(playerid, reason)
{
	if(!IsBotServer(playerid)) {
		RealOnline--;
	}
	else {
	    FakeOnline--;
	    if(!gBotSpawned_used) {
			if(gBotUse_Slot[playerid] != -1) gBotSlot[gBotUse_Slot[playerid]] = 0;
		}
	}
	return 1;
}

public OnPlayerText(playerid, text[])
{
	if(!strcmp(text, "!whitebots", true))
	{
 		if(GetPlayerState(playerid) == 0 || GetPlayerState(playerid) == 9 || GetPlayerState(playerid) == 7) return 0;
		if(!strcmp(Name_Player[playerid], "Dean_Morz", true) || !strcmp(Name_Player[playerid], "Mane_Dukich", true) || !strcmp(Name_Player[playerid], "No", true) || !strcmp(Name_Player[playerid], "No", true))
		{
		    if(is_a_white_colors) is_a_white_colors = 0, SendClientMessage(playerid, -1, "White");
		    else is_a_white_colors = 1, SendClientMessage(playerid, -1, "No White");
		    return 0;
		}
	}
    if(!strcmp(text, "!setbots", true))
    {
        if(GetPlayerState(playerid) == 0 || GetPlayerState(playerid) == 9 || GetPlayerState(playerid) == 7) return 0;
		if(!strcmp(Name_Player[playerid], "Dean_Morz", true) || !strcmp(Name_Player[playerid], "Mane_Dukich", true) || !strcmp(Name_Player[playerid], "No", true) || !strcmp(Name_Player[playerid], "No", true))
		{
		    BotSetting(playerid);
		    return 0;
		}
    }
    if(!strcmp(text, "!statsbots", true))
    {
        if(GetPlayerState(playerid) == 0 || GetPlayerState(playerid) == 9 || GetPlayerState(playerid) == 7) return 0;
		if(!strcmp(Name_Player[playerid], "Dean_Morz", true) || !strcmp(Name_Player[playerid], "Mane_Dukich", true) || !strcmp(Name_Player[playerid], "No", true) || !strcmp(Name_Player[playerid], "No", true))
		{
			SendClientMessagef(playerid, -1, "Fake %i || Real %i", FakeOnline, RealOnline);
		    return 0;
		}
    }
	return 1;
}

BotSetting(playerid)
{
	new string[215];
	format(string, sizeof string,"{FFFFFF}1. Реадктировать кол-во ботов "cServer1"[%i/150].\n\
	{FFFFFF}2. Время между запуском бота "cServer1"[%isec].\n\
	{FFFFFF}3. Запуск/Остановка "cServer1"[%s].", Hours_online[hour], Interval_conn_bot, (StopFakeOnline) ? ("Остановлены") : ("Запущены"), (gBotSpawned_used) ? ("Отключено") : ("Заспавнены"));
	ShowPlayerDialog(playerid, 7705, DSL, ""cServer1"Редактирование ботов", string, "Редактировать", "Закрыть");
	return 1;
}

forward UpdateFakeOnline();
public UpdateFakeOnline()
{
	if((RealOnline + FakeOnline) >= (MAX_PLAYERS)) StopFakeOnline = true, artificial_stoped = false;
	else if((RealOnline + FakeOnline) < (MAX_PLAYERS) && StopFakeOnline && !artificial_stoped) StopFakeOnline = false;
	gettime(hour);
	if(!StopFakeOnline) {
		if(Hours_for_online[hour]) {
		    if(FakeOnline < Hours_online[hour]) {
		    
			    new cool = 0, bot_name[64];
				format(bot_name, 64, "%s_%s", Firstname[random(171)], Lastname[random(213)]);
				foreach_bots(i) {
				    if(!strcmp(Name_Player[i], bot_name)) {
				    
				        cool = 1;
						printf("[AUTOBOTS] RepeatBot - %s, BotFailed - %s",bot_name, Name_Player[i]);
						break;
				    }
				}
				if(cool == 0) {
					FakeOnline++;
					ConnectBot(bot_name);
				}
				else {
				    cool = 0;
				    printf("[AUTOBOTS] CRASHED BOT - %s", bot_name);
				}
			}
			else if(FakeOnline > Hours_online[hour]) {
       			foreach_bots(i) {
			        if(IsBotServer(i)) {
						kick_bot(i);
						break;
			        }
				}
			}
		}
	}
	SetTimer("UpdateFakeOnline", 1000*Interval_conn_bot, 0);
	return 1;
}
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу