Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //------------------------------------------------------------------------------
- #define MAX_VEHICLES (2000)
- //Инклюды
- #include a_samp
- #include foreach
- #include mxINI
- #include streamer
- //------------------------------------------------------------------------------
- #define PWN // DC - DC_CMD. PWN - PAWN.CMD. ZC - ZCMD
- //------------------------------------------------------------------------------
- #if defined DC
- #include DC_CMD
- public OnPlayerCommandReceived(playerid, cmdtext[]) return true;
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(success == -1)
- {
- return SendClientMessage(playerid, 0xFF0000AA, "Команда не найдена");
- }
- return 1;
- }
- #endif
- #if defined PWN
- #include Pawn.CMD
- public OnPlayerCommandReceived(playerid, cmd[], params[], flags) return true;
- public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
- {
- if(result == -1)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Команда не найдена");
- return 0;
- }
- return 1;
- }
- #endif
- #if defined ZC
- #include zcmd
- #define CMD COMMAND
- public OnPlayerCommandReceived(playerid, cmdtext[]) return true;
- #endif
- //------------------------------------------------------------------------------
- //Переменные
- new Float:mpX, Float:mpY, Float:mpZ, Teleport_Info, Text:Mp_Open[3];// Статичные переменные
- new Float:i_MP_x[MAX_PLAYERS],Float:i_MP_y[MAX_PLAYERS],Float:i_MP_z[MAX_PLAYERS];
- new Text:mp_number[6];//Текстдрав отсчета
- enum { d_mp } // Диалог
- new car_ids[MAX_VEHICLES];
- new car_id, count_veh;// Спавн каров
- new Timer_Number;//Отсчет таймера
- new Leson_Timer = 0;//Отсчет таймера
- new i_mp[MAX_PLAYERS];//Игрок на мп
- new tp_na_mp = 0;//Телепорт на мп
- new bool:User_MP[MAX_PLAYERS];
- new New_Cars = 0;
- new Text3D:text_mp;
- new Text3D: Gamers_Team[MAX_PLAYERS];
- new Player_Skin[MAX_PLAYERS];
- new game_mp;
- new global_str[144];
- //----- Викторина
- new cell_1;
- new cell_2;
- new otvet;
- new open_game;
- new otvet_game;
- //------ Ответ на вопрос
- new v_otvet[144];
- new v_otvet_1;
- new v_vopros[144];
- new v_game;
- //------
- new open_mp_status;
- new cell_open_mp;
- //------- [ Диалоги ] -------
- #define d_mpveh 6666
- #define d_mp_gun 6667
- #define d_mpveh_id 6668
- #define d_compl 6669
- #define d_games 6670
- #define d_games_1 6671
- #define d_games_2 6672
- #define d_go_cell 6673
- #define d_otvet 6674
- #define d_open_mp 6675
- #define d_open_mp_2 6676
- #define v_games 6677
- #define v_games_2 6678
- #define v_open_games 6679
- //---------------------------
- public OnPlayerConnect(playerid)
- {
- if(Teleport_Info == 1)
- {
- foreach(new i : Player)
- {
- TextDrawShowForPlayer(i,Mp_Open[0]);
- TextDrawShowForPlayer(i,Mp_Open[1]);
- TextDrawShowForPlayer(i,Mp_Open[2]);
- }
- }
- return true;
- }
- public OnFilterScriptInit()
- {
- print("Система мероприятий by Salery успешно запущена");
- //--------------------------------------------------------------------------
- mp_number[0] = TextDrawCreate(404.352935, 194.000000, "usebox");
- TextDrawLetterSize(mp_number[0], 0.000000, 3.248147);
- TextDrawTextSize(mp_number[0], 230.941162, 0.000000);
- TextDrawAlignment(mp_number[0], 1);
- TextDrawColor(mp_number[0], 0);
- TextDrawUseBox(mp_number[0], true);
- TextDrawBoxColor(mp_number[0], 102);
- TextDrawSetShadow(mp_number[0], 0);
- TextDrawSetOutline(mp_number[0], 0);
- TextDrawFont(mp_number[0], 0);
- mp_number[1] = TextDrawCreate(399.647064, 197.500000, "usebox");
- TextDrawLetterSize(mp_number[1], 0.000000, 2.340739);
- TextDrawTextSize(mp_number[1], 234.705871, 0.000000);
- TextDrawAlignment(mp_number[1], 1);
- TextDrawColor(mp_number[1], 0);
- TextDrawUseBox(mp_number[1], true);
- TextDrawBoxColor(mp_number[1], 102);
- TextDrawSetShadow(mp_number[1], 0);
- TextDrawSetOutline(mp_number[1], 0);
- TextDrawFont(mp_number[1], 0);
- mp_number[2] = TextDrawCreate(271.529205, 198.333282, "START: 3");
- TextDrawLetterSize(mp_number[2], 0.449999, 1.600000);
- TextDrawAlignment(mp_number[2], 1);
- TextDrawColor(mp_number[2], -1);
- TextDrawSetShadow(mp_number[2], 0);
- TextDrawSetOutline(mp_number[2], 1);
- TextDrawBackgroundColor(mp_number[2], 51);
- TextDrawFont(mp_number[2], 2);
- TextDrawSetProportional(mp_number[2], 1);
- mp_number[3] = TextDrawCreate(271.529205, 198.333282, "START: 2");
- TextDrawLetterSize(mp_number[3], 0.449999, 1.600000);
- TextDrawAlignment(mp_number[3], 1);
- TextDrawColor(mp_number[3], -1);
- TextDrawSetShadow(mp_number[3], 0);
- TextDrawSetOutline(mp_number[3], 1);
- TextDrawBackgroundColor(mp_number[2], 51);
- TextDrawFont(mp_number[3], 2);
- TextDrawSetProportional(mp_number[3], 1);
- mp_number[4] = TextDrawCreate(271.529205, 198.333282, "START: 1");
- TextDrawLetterSize(mp_number[4], 0.449999, 1.600000);
- TextDrawAlignment(mp_number[4], 1);
- TextDrawColor(mp_number[4], -1);
- TextDrawSetShadow(mp_number[4], 0);
- TextDrawSetOutline(mp_number[4], 1);
- TextDrawBackgroundColor(mp_number[4], 51);
- TextDrawFont(mp_number[4], 2);
- TextDrawSetProportional(mp_number[4], 1);
- mp_number[5] = TextDrawCreate(271.529205, 198.333282, "MP START");
- TextDrawLetterSize(mp_number[4], 0.449999, 1.600000);
- TextDrawAlignment(mp_number[4], 1);
- TextDrawColor(mp_number[4], -1);
- TextDrawSetShadow(mp_number[4], 0);
- TextDrawSetOutline(mp_number[4], 1);
- TextDrawBackgroundColor(mp_number[4], 51);
- TextDrawFont(mp_number[4], 2);
- TextDrawSetProportional(mp_number[4], 1);
- Mp_Open[0] = TextDrawCreate(639.058837, 396.666687, "LD_SPAC:white");
- TextDrawLetterSize(Mp_Open[0], 0.000000, 0.000000);
- TextDrawTextSize(Mp_Open[0], -92.705924, 29.166667);
- TextDrawAlignment(Mp_Open[0], 1);
- TextDrawColor(Mp_Open[0], 1282648416);
- TextDrawSetShadow(Mp_Open[0], 0);
- TextDrawSetOutline(Mp_Open[0], 0);
- TextDrawBackgroundColor(Mp_Open[0], 1282648416);
- TextDrawFont(Mp_Open[0], 4);
- Mp_Open[1] = TextDrawCreate(634.941162, 405.166687, "usebox");
- TextDrawLetterSize(Mp_Open[1], 0.000000, 1.303701);
- TextDrawTextSize(Mp_Open[1], 549.058837, 0.000000);
- TextDrawAlignment(Mp_Open[1], 1);
- TextDrawColor(Mp_Open[1], 0);
- TextDrawUseBox(Mp_Open[1], true);
- TextDrawBoxColor(Mp_Open[1], 102);
- TextDrawSetShadow(Mp_Open[1], 0);
- TextDrawSetOutline(Mp_Open[1], 0);
- TextDrawFont(Mp_Open[1], 0);
- Mp_Open[2] = TextDrawCreate(565.176086, 404.250122, "Open MP. /mp");
- TextDrawLetterSize(Mp_Open[2] , 0.174235, 1.320000);
- TextDrawAlignment(Mp_Open[2] , 1);
- TextDrawColor(Mp_Open[2] , -1);
- TextDrawSetShadow(Mp_Open[2] , 0);
- TextDrawSetOutline(Mp_Open[2] , 1);
- TextDrawBackgroundColor(Mp_Open[2] , 51);
- TextDrawFont(Mp_Open[2] , 2);
- TextDrawSetProportional(Mp_Open[2] , 1);
- //--------------------------------------------------------------------------
- return true;
- }
- CMD:mplite(playerid, params[])
- {
- new Info_Text[40];
- new Info_Text_2[40];
- MP_Dostup(playerid);
- if(Teleport_Info == 1) { format(Info_Text, sizeof(Info_Text), "{4CA979}[Открыто]"); } else { format(Info_Text, sizeof(Info_Text), "{FF0000}[Закрыто]"); }
- if(tp_na_mp == 1) { format(Info_Text_2, sizeof(Info_Text_2), "{4CA979}[Включено]"); } else { format(Info_Text_2, sizeof(Info_Text_2), "{FF0000}[Выключено]"); }
- if(User_MP[playerid] == true)
- {
- new _string[1000 + 12];
- format(_string, sizeof(_string), "Название\tИнформация\n\
- 1. Телепорт на мероприятие \t %s\n\
- 2. Создать машины в ряд \t {39814F}[До 10шт]\n\
- 3. Объявить о мероприятии \t {39814F}[Всем]\n\
- 4. Раздать оружие \t {39814F}[ALL MP]\n\
- 5. Раздать хп \t {39814F}[ALL MP]\n\
- 6. Раздать броню \t {39814F}[ALL MP]\n\
- 7. Разбить на команды \t {39814F}[ALL MP]\n\
- 8. Обезаружить игроков \t {39814F}[ALL MP]\n\
- 9. Заморозить игроков \t {39814F}[ALL MP]\n\
- 10. Разморозить игроков \t {39814F}[ALL MP]\n\
- 11. Запустить обратный отсчет \t {39814F}[3 сек]\n\
- 12. Удалить созданные машины \t {FF0000}[ALL]\n\
- {C070CC}13. Мини игры \t {FF0000}[Разработка]{FFFFFF}\n\
- 14. ТП на МП после смерти \t %s\n\
- 15. ТП игроков на свои места \t {39814F}[ALL MP]\n\
- 16. Выстроить всех игроков в ряд \t {39814F}[ALL MP]\n\
- {4AB5BF}17. Отключить всех от мп \t {FF0000}[После мп обязательно]\n\
- {4A79BF}18. Объявить победителя \t {39814F}[ID]", Info_Text, Info_Text_2);
- return ShowPlayerDialog(playerid, d_mp, DIALOG_STYLE_TABLIST_HEADERS,"Меню управления мероприятиями", _string, "Выбрать","Отмена");
- }
- else if(Teleport_Info == 1)
- {
- if(open_mp_status == 1)
- {
- if(game_mp > cell_open_mp)
- {
- SendClientMessageToAll(0x46AC81AA, "Телепорт на мероприятие автоматически закрыт");
- Teleport_Info = 0;
- foreach(new i : Player)
- {
- TextDrawHideForPlayer(i,Mp_Open[0]);
- TextDrawHideForPlayer(i,Mp_Open[1]);
- TextDrawHideForPlayer(i,Mp_Open[2]);
- }
- Delete3DTextLabel(text_mp);
- cell_open_mp = 0;
- game_mp = 0;
- return Teleport_Info = 0;
- }
- else
- {
- SetPlayerPos(playerid, mpX,mpY,mpZ);
- i_mp[playerid] = 1;
- game_mp ++;
- Update3DTextLabelText(text_mp, 0xFFFFFFFF, global_str);
- GetPlayerPos(playerid, i_MP_x[playerid],i_MP_y[playerid],i_MP_z[playerid]);
- }
- }
- else
- {
- SetPlayerPos(playerid, mpX,mpY,mpZ);
- i_mp[playerid] = 1;
- GetPlayerPos(playerid, i_MP_x[playerid],i_MP_y[playerid],i_MP_z[playerid]);
- }
- }
- else return true;
- return true;
- }
- public OnPlayerSpawn(playerid)
- {
- if(tp_na_mp == 1)
- {
- if(i_mp[playerid] == 1) return SetPlayerPos(playerid,mpX,mpY,mpZ);
- }
- return true;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- RemovePlayerAttachedObject(playerid, 4);
- if(i_mp[playerid] == 1 && tp_na_mp == 0)//Если игрок на мероприятии и телепорт на мп после смерти отключен
- {
- Delete3DTextLabel(Gamers_Team[playerid]);//Удаляем 3d текст над игроком
- SetPlayerSkin(playerid,Player_Skin[playerid]);//Возвращаем старый скин
- i_mp[playerid] = 0;// Отключаем игрока от мп
- }
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case d_mp:
- {
- if(!response) return true;
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, d_open_mp, DIALOG_STYLE_LIST, "Ограничения", "Ограничить кол-во участников\nБез ограничений\nЗакрыть телепорт","Выбрать","Отмена");
- }
- case 1: ShowPlayerDialog(playerid, d_mpveh_id, DIALOG_STYLE_INPUT, " ","Введите количество машин\n\nМинимум 1, максимум 10","Принять","Отмена");
- case 2: if(Teleport_Info == 1) return SendClientMessageToAll(0x409961AA, "Внимание: открыт телепорт не мероприятие. /mp"); else return SendClientMessage(playerid, 0xFF0000, "Телепортация закрыта");
- case 3:
- {
- ShowPlayerDialog(playerid, d_mp_gun, DIALOG_STYLE_LIST, "Выберите оружие", "Катана\n\
- Лопата\n\
- Дигл\n\
- AK-47\n\
- M4\n\
- Парашют", "Выбрать", "Отмена");
- }
- case 4:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(new i : Player)
- {
- if(i_mp[i] == 1) SetPlayerHealth(i, 100);
- return SendClientMessage(i, 0x539B63AA, "Администратор выдал вам жизни");
- }
- }
- case 5:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(new i : Player)
- {
- if(i_mp[i] == 1) SetPlayerArmour(i, 100);
- SetPlayerAttachedObject(playerid, 4, 373, 1, 0.286006,-0.038657,-0.158132, 67.128456,21.916156,33.972290, 1,1,1);
- return SendClientMessage(i, 0x539B63AA, "Администратор выдал вам броню");
- }
- }
- case 6:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- new team_clist = 0;
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- if(User_MP[i] == true) continue;
- if(team_clist == 1)
- {
- GetPlayerSkin(Player_Skin[i]);
- SetPlayerColor(i, 0xDC1010AA);
- team_clist = 0;
- Gamers_Team[i] = Create3DTextLabel("Красный",0xDC1010AA,0.0,0.0,1500.0,30.0,-1,0);
- Attach3DTextLabelToPlayer(Gamers_Team[i], playerid, 0.0, 0.0, 0.7);
- SetPlayerSkin(playerid, 28);
- }
- else
- {
- GetPlayerSkin(Player_Skin[i]);
- SetPlayerColor(i, 0x3F24DAAA);
- team_clist = 1;
- Gamers_Team[i] = Create3DTextLabel("Синий",0x3F24DAAA,0.0,0.0,1500.0,30.0,-1,0);
- Attach3DTextLabelToPlayer(Gamers_Team[i], playerid, 0.0, 0.0, 0.7);
- SetPlayerSkin(playerid, 30);
- }
- }
- }
- }
- case 7:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- if(User_MP[i] == true) continue;
- ResetPlayerWeapons(i);
- SendClientMessage(i, 0x539B63AA, "Администратор забрал ваше оружие");
- }
- }
- }
- case 8:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- if(User_MP[i] == true) continue;
- TogglePlayerControllable(i,0);
- SendClientMessage(i, 0x539B63AA, "Вы были заморожены администратором");
- }
- }
- }
- case 9:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- if(User_MP[i] == true) continue;
- TogglePlayerControllable(i,1);
- SendClientMessage(i, 0x539B63AA, "Вы были разморожены администратором");
- }
- }
- }
- case 10:
- {
- // if(GetPVarInt(playerid, "AntiFlood") > gettime()) return SendClientMessage(playerid, -1, "Можно использовать раз в минуту");
- Timer_Number = SetTimer("@_Number_Start", 1000, 1);
- SetPVarInt(playerid, "AntiFlood", gettime() + 60);
- }
- case 11:
- {
- for(new i; i < New_Cars; i ++)
- {
- DestroyVehicle(car_ids[i]);
- }
- return SendClientMessage(playerid, 0x539B63AA, "Все машины удалены");
- }
- case 12:
- {
- ShowPlayerDialog(playerid, d_games, DIALOG_STYLE_LIST, "Мини игры", "1. Викторина\n2. Ответ на вопрос", "Выбрать","Отмена");
- }
- case 13:
- {
- if(tp_na_mp == 0) return tp_na_mp = 1; else return tp_na_mp = 0;
- }
- case 14:
- {
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- SetPlayerPos(i,i_MP_x[i],i_MP_y[i],i_MP_z[i]);
- SendClientMessage(i, 0x60BC63AA, "Администратор телепортировал вас на свое место");
- }
- }
- }
- case 15:
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x,y,z);
- new number_coord;
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- number_coord += 2;
- SetPlayerPos(i,x + number_coord,y,z);
- TogglePlayerControllable(i,0);
- }
- }
- SendClientMessage(playerid,0x60BC63AA, "Игроки построены и заморожены");
- }
- case 16:
- {
- foreach(new i : Player)
- {
- if(i_mp[i] == 1)
- {
- i_mp[i] = 0;
- SendClientMessage(playerid, 0x60BC63AA, "Вы были отключены от мероприятия администратором");
- }
- }
- }
- case 17:
- {
- ShowPlayerDialog(playerid, d_compl, DIALOG_STYLE_INPUT, " ","Введите id игрока а мы выведим его ник в общий чат","Принять","Отмена");
- }
- }
- }
- case d_open_mp:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(Teleport_Info == 1) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт уже открыт");
- ShowPlayerDialog(playerid, d_open_mp_2, DIALOG_STYLE_INPUT, " ", "Введите максимальное кол-во участников. От 1 до 300", "Ввод", "Отмена");
- }
- case 1:
- {
- if(Teleport_Info == 1) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт уже открыт");
- GetPlayerPos(playerid, mpX, mpY, mpZ);
- Teleport_Info = 1;
- foreach(new i : Player)
- {
- TextDrawShowForPlayer(i,Mp_Open[0]);
- TextDrawShowForPlayer(i,Mp_Open[1]);
- TextDrawShowForPlayer(i,Mp_Open[2]);
- }
- SendClientMessageToAll(0x409961AA, "Внимание: открыт телепорт на мероприятие. /mp");
- new Name[24];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(global_str, sizeof(global_str), "Телепорт на мероприятие {32A449}открыт.{FFFFFF}\nСоздатель: {3293A4}%s",Name);
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x,y,z);
- text_mp = Create3DTextLabel(global_str, 0xFFFFFFFF, x,y,z, 40.0, -1 );
- return true;
- }
- case 2:
- {
- if(Teleport_Info == 0) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт не открыт");
- Teleport_Info = 0;
- foreach(new i : Player)
- {
- TextDrawHideForPlayer(i,Mp_Open[0]);
- TextDrawHideForPlayer(i,Mp_Open[1]);
- TextDrawHideForPlayer(i,Mp_Open[2]);
- }
- Delete3DTextLabel(text_mp);
- cell_open_mp = 0;
- game_mp = 0;
- return SendClientMessageToAll(0x409961AA, "Внимание: телепорт на мероприятие {FF0000}закрыт");
- }
- }
- }
- }
- case d_open_mp_2:
- {
- if(response)
- {
- if(strval(inputtext) < 1 || strval(inputtext) > 300)
- {
- return ShowPlayerDialog(playerid, d_open_mp_2, DIALOG_STYLE_INPUT, " ", "Введите максимальное кол-во участников. От 1 до 300", "Ввод", "Отмена");
- }
- else
- {
- cell_open_mp = strval(inputtext);
- open_mp_status = 1;
- GetPlayerPos(playerid, mpX, mpY, mpZ);
- Teleport_Info = 1;
- foreach(new i : Player)
- {
- TextDrawShowForPlayer(i,Mp_Open[0]);
- TextDrawShowForPlayer(i,Mp_Open[1]);
- TextDrawShowForPlayer(i,Mp_Open[2]);
- }
- new _str[140]; new Name[24];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(_str, sizeof(_str), "Телепорт на мероприятие {32A449}открыт.{FFFFFF}. Кол-во свободных мест [%d]\nСоздатель: {3293A4}%s",cell_open_mp,Name);
- SendClientMessageToAll(0x409961AA, _str);
- SendClientMessageToAll(0x409961AA, "Для телепорта используйте /mp");
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x,y,z);
- text_mp = CreateDynamic3DTextLabel(_str, 0xFFFFFFFF, x,y,z, 40.0, INVALID_PLAYER_ID,INVALID_PLAYER_ID,0,-1,-1,-1,100.0);
- }
- }
- }
- case d_games:
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, d_games_1, DIALOG_STYLE_INPUT, "Мини игры", "Введите число от 1 до 999", "Ввод","Отмена");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, v_games, DIALOG_STYLE_INPUT, "Мини игры", "Введите ваш вопрос. Максимум 100 символов.\n\nВажно: ответ на вопрос должен быть одним словом и без цифр", "Ввод","Отмена");
- }
- }
- }
- case v_games:
- {
- if(strval(inputtext) > 100 || strlen(inputtext) > 100) return ShowPlayerDialog(playerid, v_games, DIALOG_STYLE_INPUT, "Мини игры", "Введите ваш вопрос. Максимум 100 символов", "Ввод","Отмена");
- format(v_vopros, sizeof(v_vopros), "%s",strlen(inputtext));
- ShowPlayerDialog(playerid, v_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите ответ на вопрос. Максимум 20 символов", "Ввод","Отмена");
- }
- case v_games_2:
- {
- if(response)
- {
- if(strval(inputtext) > 20 || strval(inputtext) > 20) return ShowPlayerDialog(playerid, v_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите ответ на вопрос. Максимум 20 символов", "Ввод","Отмена");
- format(v_otvet, sizeof(v_otvet), "%s",strlen(inputtext));
- v_otvet_1 = strlen(inputtext);
- new string[256];
- format(string,sizeof(string), "Ваш вопрос: %s\nВаш ответ: %s\nЗапустить игру?",v_vopros,v_otvet);
- ShowPlayerDialog(playerid, v_open_games, DIALOG_STYLE_MSGBOX, " ", string, "Запуск","Отмена");
- }
- }
- case v_open_games:
- {
- if(response)
- {
- v_game = 1;
- new _str[144];
- format(_str,sizeof(_str), "[СЛОВА]: {FFFFFF}%s",v_vopros);
- SendClientMessageToAll(0x409961AA, _str);
- SendClientMessageToAll(0x409961AA, "Ответ писать в общий чат");
- }
- }
- case d_games_1:
- {
- if(response)
- {
- if(strval(inputtext) < 1 || strval(inputtext) > 999)
- {
- return ShowPlayerDialog(playerid, d_games_1, DIALOG_STYLE_INPUT, "Мини игры", "Введите число от 1 до 999", "Ввод","Отмена");
- }
- else
- {
- cell_1 = strval(inputtext);
- ShowPlayerDialog(playerid, d_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите второе число от 1 до 999", "Ввод","Отмена");
- }
- }
- }
- case d_games_2:
- {
- if(response)
- {
- if(strval(inputtext) < 1 || strval(inputtext) > 999)
- {
- return ShowPlayerDialog(playerid, d_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите второе число от 1 до 999", "Ввод","Отмена");
- }
- else
- {
- cell_2 = strval(inputtext);
- new string[200];
- otvet_game = cell_1 + cell_2;
- format(string, sizeof(string), "{FFFFFF}Ваше первое число: {61B08E}%d\n{FFFFFF}Ваше второе число: {61B08E}%d\n\n{49DF9E}Итог: %d",cell_1, cell_2, otvet_game);
- ShowPlayerDialog(playerid, d_go_cell, DIALOG_STYLE_MSGBOX," ", string, "Запустить","Отмена");
- }
- }
- }
- case d_otvet:
- {
- if(response)
- {
- otvet = strval(inputtext);
- if(otvet == otvet_game)
- {
- new _str[256]; new Name[24];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(_str, sizeof(_str), "{61B08E}[ВИКТОРИНА] {FFFFFF}Правильный ответ: {61B08E}%d. {FFFFFF}Ответил: {61B08E}%s",otvet_game,Name);
- SendClientMessageToAll(0xFFFFFFFF, _str);
- open_game = 0;
- }
- else return SendClientMessage(playerid, -1, "{FF0000}Неправильный ответ");
- }
- }
- case d_go_cell:
- {
- if(response)
- {
- new string[256];
- format(string,sizeof(string), "{6AB393}[ВИКТОРИНА] {FFFFFF}Сколько будет {6AB393}%d {FFFFFF}+ {6AB393}%d",cell_1, cell_2);
- SendClientMessageToAll(0xFFFFFFFF, string);
- new Name[24];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(string, sizeof(string), "{6AB393}Администратор викторины: {FFFFFF}%s",Name);
- SendClientMessageToAll(0xFFFFFFFF, string);
- SendClientMessageToAll(0xFFFFFFFF, "{6AB393}Для ответа используйте /vot");
- open_game = 1;
- }
- }
- case d_compl:
- {
- if(strval(inputtext) < 0 || strval(inputtext) > 1000) return SendClientMessage(playerid, 0xFF0000AA, "Ид игрока должен быть от 1 до 1000");
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000AA, "Игрока под данным ид нет в сети");
- new string[144]; new Name[24];
- GetPlayerName(strval(inputtext), Name, sizeof(Name));
- format(string,sizeof(string), "{4AB1BF}Внимание: {BCBCBC}Победителем мероприятия объявляется %s[%d]. Поздравляем.", Name,playerid);
- SendClientMessageToAll(0xFF0000AA, string);
- }
- case d_mpveh_id:
- {
- if(strval(inputtext) < 1 ||strval(inputtext) > 10)
- {
- return ShowPlayerDialog(playerid, d_mpveh_id, DIALOG_STYLE_INPUT, " ","Введите количество машин\n\nМинимум 1, максимум 10","Принять","Отмена");
- }
- count_veh = strval(inputtext);
- new string[200];
- format(string,sizeof(string), "Вы ввели %d символов", count_veh);
- SendClientMessage(playerid, -1, string);
- ShowPlayerDialog(playerid, d_mpveh, DIALOG_STYLE_INPUT, " ","Введите id машин","Принять","Отмена");
- }
- case d_mp_gun:
- {
- if(response)
- {
- new gun_id;
- switch(listitem)
- {
- case 0: gun_id = 8;
- case 1: gun_id = 6;
- case 2: gun_id = 24;
- case 3: gun_id = 30;
- case 4: gun_id = 31;
- case 5: gun_id = 46;
- }
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- new _string[124];
- if(gun_id == 8) format(_string, 124, "Администратор выдал вам катану");
- if(gun_id == 6) format(_string, 124, "Администратор выдал вам лопату");
- if(gun_id == 24) format(_string, 124, "Администратор выдал вам дигл");
- if(gun_id == 30) format(_string, 124, "Администратор выдал вам AK-47");
- if(gun_id == 31) format(_string, 124, "Администратор выдал вам M4");
- if(gun_id == 46) format(_string, 124, "Администратор выдал вам парашют");
- foreach(new i : Player)
- {
- if(IsPlayerInRangeOfPoint(i, 20.0, x, y, z)) return GivePlayerWeapon(i, gun_id, 300);
- SendClientMessage(i, 0x539B63AA, _string);
- }
- }
- }
- case d_mpveh:
- {
- if(strval(inputtext) < 400 || strval(inputtext) > 611)
- {
- return ShowPlayerDialog(playerid, d_mpveh, DIALOG_STYLE_INPUT, " ","Введите id машин","Принять","Отмена");
- }
- car_id = strval(inputtext);
- new Float:x,Float:y,Float:z, Float:Angle;
- GetPlayerFacingAngle(playerid, Angle);
- GetPlayerPos(playerid,x,y,z);
- new coord = 0;
- for(new i; i < count_veh; i ++)
- {
- coord += 10;
- New_Cars ++;
- car_ids[i] = CreateVehicle(car_id, x + coord, y, z, Angle, 0, 1, 60);
- }
- }
- }
- return true;
- }
- @_Number_Start();
- @_Number_Start()
- {
- switch(Leson_Timer)
- {
- case 0:
- {
- foreach(new i : Player)
- {
- for(new b; b < 3; b++)
- {
- TextDrawShowForPlayer(i, mp_number[b]);
- }
- PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
- }
- Leson_Timer ++;
- }
- case 1:
- {
- foreach(new i : Player)
- {
- TextDrawHideForPlayer(i, mp_number[2]);
- TextDrawShowForPlayer(i, mp_number[3]);
- PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
- }
- Leson_Timer ++;
- }
- case 2:
- {
- foreach(new i : Player)
- {
- TextDrawHideForPlayer(i, mp_number[3]);
- TextDrawShowForPlayer(i, mp_number[4]);
- PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
- }
- Leson_Timer ++;
- }
- case 3:
- {
- foreach(new i : Player)
- {
- TextDrawHideForPlayer(i, mp_number[4]);
- TextDrawShowForPlayer(i, mp_number[5]);
- PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);
- }
- Leson_Timer ++;
- }
- case 4:
- {
- foreach(new i : Player)
- {
- for(new b; b < 6; b ++)
- {
- TextDrawHideForPlayer(i, mp_number[b]);
- }
- }
- KillTimer(Timer_Number);
- Leson_Timer = 0;
- }
- }
- return true;
- }
- stock MP_Dostup(playerid)
- {
- new namep[MAX_PLAYER_NAME];
- new yes_no;
- new file = ini_openFile("Admin_MP.ini");
- GetPlayerName(playerid, namep, sizeof(namep));
- if(ini_getInteger(file, namep, yes_no) == 0)
- {
- switch(yes_no)
- {
- case 0: User_MP[playerid] = false;
- case 1: User_MP[playerid] = true;
- }
- }
- else if(IsPlayerAdmin(playerid)) User_MP[playerid] = true; else User_MP[playerid] = false;
- ini_closeFile(file);
- return true;
- }
- CMD:vot(playerid, params[])
- {
- if(open_game == 1)
- {
- ShowPlayerDialog(playerid, d_otvet, DIALOG_STYLE_INPUT, " ", "Введите ответ:", "Ввод","Отмена");
- }
- return true;
- }
- public OnPlayerText(playerid, text[])
- {
- if(v_game == 1)
- {
- if(strlen(text) == v_otvet_1)
- {
- new Name[24]; new str[144];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(str, sizeof(str), "Правильный ответ: %s. Ответил: %s",v_otvet, Name);
- SendClientMessageToAll(0x61B08EAA,str);
- }
- }
- }
- ______
- Не забудьте создать файл Admin_MP.ini в папке scriptfiles !!!
- В нём указываете имена админов которые смогут создавать МП и управлять ими!
- Например:
- Vova_Ivanov = 1 ( обязательно ставьте "= 1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement