Advertisement
Guest User

[SCRIPT] Система МП

a guest
Mar 13th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.82 KB | None | 0 0
  1. //------------------------------------------------------------------------------
  2. #define MAX_VEHICLES (2000)
  3. //Инклюды
  4. #include a_samp
  5. #include foreach
  6. #include mxINI
  7. #include streamer
  8. //------------------------------------------------------------------------------
  9. #define PWN // DC - DC_CMD. PWN - PAWN.CMD. ZC - ZCMD
  10. //------------------------------------------------------------------------------
  11. #if defined DC
  12. #include DC_CMD
  13. public OnPlayerCommandReceived(playerid, cmdtext[]) return true;
  14. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  15. {
  16. if(success == -1)
  17. {
  18. return SendClientMessage(playerid, 0xFF0000AA, "Команда не найдена");
  19. }
  20. return 1;
  21. }
  22. #endif
  23.  
  24. #if defined PWN
  25. #include Pawn.CMD
  26. public OnPlayerCommandReceived(playerid, cmd[], params[], flags) return true;
  27. public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
  28. {
  29. if(result == -1)
  30. {
  31. SendClientMessage(playerid, 0xFF0000AA, "Команда не найдена");
  32. return 0;
  33. }
  34.  
  35. return 1;
  36. }
  37. #endif
  38.  
  39. #if defined ZC
  40. #include zcmd
  41. #define CMD COMMAND
  42. public OnPlayerCommandReceived(playerid, cmdtext[]) return true;
  43. #endif
  44. //------------------------------------------------------------------------------
  45.  
  46. //Переменные
  47. new Float:mpX, Float:mpY, Float:mpZ, Teleport_Info, Text:Mp_Open[3];// Статичные переменные
  48. new Float:i_MP_x[MAX_PLAYERS],Float:i_MP_y[MAX_PLAYERS],Float:i_MP_z[MAX_PLAYERS];
  49. new Text:mp_number[6];//Текстдрав отсчета
  50. enum { d_mp } // Диалог
  51.  
  52.  
  53. new car_ids[MAX_VEHICLES];
  54. new car_id, count_veh;// Спавн каров
  55. new Timer_Number;//Отсчет таймера
  56. new Leson_Timer = 0;//Отсчет таймера
  57. new i_mp[MAX_PLAYERS];//Игрок на мп
  58. new tp_na_mp = 0;//Телепорт на мп
  59. new bool:User_MP[MAX_PLAYERS];
  60. new New_Cars = 0;
  61. new Text3D:text_mp;
  62. new Text3D: Gamers_Team[MAX_PLAYERS];
  63. new Player_Skin[MAX_PLAYERS];
  64. new game_mp;
  65. new global_str[144];
  66. //----- Викторина
  67. new cell_1;
  68. new cell_2;
  69. new otvet;
  70. new open_game;
  71. new otvet_game;
  72. //------ Ответ на вопрос
  73. new v_otvet[144];
  74. new v_otvet_1;
  75. new v_vopros[144];
  76. new v_game;
  77. //------
  78. new open_mp_status;
  79. new cell_open_mp;
  80. //------- [ Диалоги ] -------
  81. #define d_mpveh 6666
  82. #define d_mp_gun 6667
  83. #define d_mpveh_id 6668
  84. #define d_compl 6669
  85. #define d_games 6670
  86. #define d_games_1 6671
  87. #define d_games_2 6672
  88. #define d_go_cell 6673
  89. #define d_otvet 6674
  90. #define d_open_mp 6675
  91. #define d_open_mp_2 6676
  92. #define v_games 6677
  93. #define v_games_2 6678
  94. #define v_open_games 6679
  95. //---------------------------
  96. public OnPlayerConnect(playerid)
  97. {
  98. if(Teleport_Info == 1)
  99. {
  100. foreach(new i : Player)
  101. {
  102. TextDrawShowForPlayer(i,Mp_Open[0]);
  103. TextDrawShowForPlayer(i,Mp_Open[1]);
  104. TextDrawShowForPlayer(i,Mp_Open[2]);
  105. }
  106. }
  107. return true;
  108. }
  109. public OnFilterScriptInit()
  110. {
  111. print("Система мероприятий by Salery успешно запущена");
  112. //--------------------------------------------------------------------------
  113. mp_number[0] = TextDrawCreate(404.352935, 194.000000, "usebox");
  114. TextDrawLetterSize(mp_number[0], 0.000000, 3.248147);
  115. TextDrawTextSize(mp_number[0], 230.941162, 0.000000);
  116. TextDrawAlignment(mp_number[0], 1);
  117. TextDrawColor(mp_number[0], 0);
  118. TextDrawUseBox(mp_number[0], true);
  119. TextDrawBoxColor(mp_number[0], 102);
  120. TextDrawSetShadow(mp_number[0], 0);
  121. TextDrawSetOutline(mp_number[0], 0);
  122. TextDrawFont(mp_number[0], 0);
  123.  
  124. mp_number[1] = TextDrawCreate(399.647064, 197.500000, "usebox");
  125. TextDrawLetterSize(mp_number[1], 0.000000, 2.340739);
  126. TextDrawTextSize(mp_number[1], 234.705871, 0.000000);
  127. TextDrawAlignment(mp_number[1], 1);
  128. TextDrawColor(mp_number[1], 0);
  129. TextDrawUseBox(mp_number[1], true);
  130. TextDrawBoxColor(mp_number[1], 102);
  131. TextDrawSetShadow(mp_number[1], 0);
  132. TextDrawSetOutline(mp_number[1], 0);
  133. TextDrawFont(mp_number[1], 0);
  134.  
  135. mp_number[2] = TextDrawCreate(271.529205, 198.333282, "START: 3");
  136. TextDrawLetterSize(mp_number[2], 0.449999, 1.600000);
  137. TextDrawAlignment(mp_number[2], 1);
  138. TextDrawColor(mp_number[2], -1);
  139. TextDrawSetShadow(mp_number[2], 0);
  140. TextDrawSetOutline(mp_number[2], 1);
  141. TextDrawBackgroundColor(mp_number[2], 51);
  142. TextDrawFont(mp_number[2], 2);
  143. TextDrawSetProportional(mp_number[2], 1);
  144.  
  145. mp_number[3] = TextDrawCreate(271.529205, 198.333282, "START: 2");
  146. TextDrawLetterSize(mp_number[3], 0.449999, 1.600000);
  147. TextDrawAlignment(mp_number[3], 1);
  148. TextDrawColor(mp_number[3], -1);
  149. TextDrawSetShadow(mp_number[3], 0);
  150. TextDrawSetOutline(mp_number[3], 1);
  151. TextDrawBackgroundColor(mp_number[2], 51);
  152. TextDrawFont(mp_number[3], 2);
  153. TextDrawSetProportional(mp_number[3], 1);
  154.  
  155. mp_number[4] = TextDrawCreate(271.529205, 198.333282, "START: 1");
  156. TextDrawLetterSize(mp_number[4], 0.449999, 1.600000);
  157. TextDrawAlignment(mp_number[4], 1);
  158. TextDrawColor(mp_number[4], -1);
  159. TextDrawSetShadow(mp_number[4], 0);
  160. TextDrawSetOutline(mp_number[4], 1);
  161. TextDrawBackgroundColor(mp_number[4], 51);
  162. TextDrawFont(mp_number[4], 2);
  163. TextDrawSetProportional(mp_number[4], 1);
  164.  
  165. mp_number[5] = TextDrawCreate(271.529205, 198.333282, "MP START");
  166. TextDrawLetterSize(mp_number[4], 0.449999, 1.600000);
  167. TextDrawAlignment(mp_number[4], 1);
  168. TextDrawColor(mp_number[4], -1);
  169. TextDrawSetShadow(mp_number[4], 0);
  170. TextDrawSetOutline(mp_number[4], 1);
  171. TextDrawBackgroundColor(mp_number[4], 51);
  172. TextDrawFont(mp_number[4], 2);
  173. TextDrawSetProportional(mp_number[4], 1);
  174.  
  175. Mp_Open[0] = TextDrawCreate(639.058837, 396.666687, "LD_SPAC:white");
  176. TextDrawLetterSize(Mp_Open[0], 0.000000, 0.000000);
  177. TextDrawTextSize(Mp_Open[0], -92.705924, 29.166667);
  178. TextDrawAlignment(Mp_Open[0], 1);
  179. TextDrawColor(Mp_Open[0], 1282648416);
  180. TextDrawSetShadow(Mp_Open[0], 0);
  181. TextDrawSetOutline(Mp_Open[0], 0);
  182. TextDrawBackgroundColor(Mp_Open[0], 1282648416);
  183. TextDrawFont(Mp_Open[0], 4);
  184.  
  185. Mp_Open[1] = TextDrawCreate(634.941162, 405.166687, "usebox");
  186. TextDrawLetterSize(Mp_Open[1], 0.000000, 1.303701);
  187. TextDrawTextSize(Mp_Open[1], 549.058837, 0.000000);
  188. TextDrawAlignment(Mp_Open[1], 1);
  189. TextDrawColor(Mp_Open[1], 0);
  190. TextDrawUseBox(Mp_Open[1], true);
  191. TextDrawBoxColor(Mp_Open[1], 102);
  192. TextDrawSetShadow(Mp_Open[1], 0);
  193. TextDrawSetOutline(Mp_Open[1], 0);
  194. TextDrawFont(Mp_Open[1], 0);
  195.  
  196. Mp_Open[2] = TextDrawCreate(565.176086, 404.250122, "Open MP. /mp");
  197. TextDrawLetterSize(Mp_Open[2] , 0.174235, 1.320000);
  198. TextDrawAlignment(Mp_Open[2] , 1);
  199. TextDrawColor(Mp_Open[2] , -1);
  200. TextDrawSetShadow(Mp_Open[2] , 0);
  201. TextDrawSetOutline(Mp_Open[2] , 1);
  202. TextDrawBackgroundColor(Mp_Open[2] , 51);
  203. TextDrawFont(Mp_Open[2] , 2);
  204. TextDrawSetProportional(Mp_Open[2] , 1);
  205. //--------------------------------------------------------------------------
  206. return true;
  207. }
  208. CMD:mplite(playerid, params[])
  209. {
  210. new Info_Text[40];
  211. new Info_Text_2[40];
  212. MP_Dostup(playerid);
  213. if(Teleport_Info == 1) { format(Info_Text, sizeof(Info_Text), "{4CA979}[Открыто]"); } else { format(Info_Text, sizeof(Info_Text), "{FF0000}[Закрыто]"); }
  214. if(tp_na_mp == 1) { format(Info_Text_2, sizeof(Info_Text_2), "{4CA979}[Включено]"); } else { format(Info_Text_2, sizeof(Info_Text_2), "{FF0000}[Выключено]"); }
  215. if(User_MP[playerid] == true)
  216. {
  217. new _string[1000 + 12];
  218. format(_string, sizeof(_string), "Название\tИнформация\n\
  219. 1. Телепорт на мероприятие \t %s\n\
  220. 2. Создать машины в ряд \t {39814F}[До 10шт]\n\
  221. 3. Объявить о мероприятии \t {39814F}[Всем]\n\
  222. 4. Раздать оружие \t {39814F}[ALL MP]\n\
  223. 5. Раздать хп \t {39814F}[ALL MP]\n\
  224. 6. Раздать броню \t {39814F}[ALL MP]\n\
  225. 7. Разбить на команды \t {39814F}[ALL MP]\n\
  226. 8. Обезаружить игроков \t {39814F}[ALL MP]\n\
  227. 9. Заморозить игроков \t {39814F}[ALL MP]\n\
  228. 10. Разморозить игроков \t {39814F}[ALL MP]\n\
  229. 11. Запустить обратный отсчет \t {39814F}[3 сек]\n\
  230. 12. Удалить созданные машины \t {FF0000}[ALL]\n\
  231. {C070CC}13. Мини игры \t {FF0000}[Разработка]{FFFFFF}\n\
  232. 14. ТП на МП после смерти \t %s\n\
  233. 15. ТП игроков на свои места \t {39814F}[ALL MP]\n\
  234. 16. Выстроить всех игроков в ряд \t {39814F}[ALL MP]\n\
  235. {4AB5BF}17. Отключить всех от мп \t {FF0000}[После мп обязательно]\n\
  236. {4A79BF}18. Объявить победителя \t {39814F}[ID]", Info_Text, Info_Text_2);
  237. return ShowPlayerDialog(playerid, d_mp, DIALOG_STYLE_TABLIST_HEADERS,"Меню управления мероприятиями", _string, "Выбрать","Отмена");
  238. }
  239. else if(Teleport_Info == 1)
  240. {
  241. if(open_mp_status == 1)
  242. {
  243. if(game_mp > cell_open_mp)
  244. {
  245. SendClientMessageToAll(0x46AC81AA, "Телепорт на мероприятие автоматически закрыт");
  246. Teleport_Info = 0;
  247. foreach(new i : Player)
  248. {
  249. TextDrawHideForPlayer(i,Mp_Open[0]);
  250. TextDrawHideForPlayer(i,Mp_Open[1]);
  251. TextDrawHideForPlayer(i,Mp_Open[2]);
  252. }
  253. Delete3DTextLabel(text_mp);
  254. cell_open_mp = 0;
  255. game_mp = 0;
  256. return Teleport_Info = 0;
  257. }
  258. else
  259. {
  260. SetPlayerPos(playerid, mpX,mpY,mpZ);
  261. i_mp[playerid] = 1;
  262. game_mp ++;
  263. Update3DTextLabelText(text_mp, 0xFFFFFFFF, global_str);
  264. GetPlayerPos(playerid, i_MP_x[playerid],i_MP_y[playerid],i_MP_z[playerid]);
  265. }
  266. }
  267. else
  268. {
  269. SetPlayerPos(playerid, mpX,mpY,mpZ);
  270. i_mp[playerid] = 1;
  271. GetPlayerPos(playerid, i_MP_x[playerid],i_MP_y[playerid],i_MP_z[playerid]);
  272. }
  273. }
  274. else return true;
  275. return true;
  276. }
  277. public OnPlayerSpawn(playerid)
  278. {
  279. if(tp_na_mp == 1)
  280. {
  281. if(i_mp[playerid] == 1) return SetPlayerPos(playerid,mpX,mpY,mpZ);
  282. }
  283. return true;
  284. }
  285. public OnPlayerDeath(playerid, killerid, reason)
  286. {
  287. RemovePlayerAttachedObject(playerid, 4);
  288. if(i_mp[playerid] == 1 && tp_na_mp == 0)//Если игрок на мероприятии и телепорт на мп после смерти отключен
  289. {
  290. Delete3DTextLabel(Gamers_Team[playerid]);//Удаляем 3d текст над игроком
  291. SetPlayerSkin(playerid,Player_Skin[playerid]);//Возвращаем старый скин
  292. i_mp[playerid] = 0;// Отключаем игрока от мп
  293. }
  294. return true;
  295. }
  296. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  297. {
  298. switch(dialogid)
  299. {
  300. case d_mp:
  301. {
  302. if(!response) return true;
  303. switch(listitem)
  304. {
  305. case 0:
  306. {
  307. ShowPlayerDialog(playerid, d_open_mp, DIALOG_STYLE_LIST, "Ограничения", "Ограничить кол-во участников\nБез ограничений\nЗакрыть телепорт","Выбрать","Отмена");
  308. }
  309. case 1: ShowPlayerDialog(playerid, d_mpveh_id, DIALOG_STYLE_INPUT, " ","Введите количество машин\n\nМинимум 1, максимум 10","Принять","Отмена");
  310. case 2: if(Teleport_Info == 1) return SendClientMessageToAll(0x409961AA, "Внимание: открыт телепорт не мероприятие. /mp"); else return SendClientMessage(playerid, 0xFF0000, "Телепортация закрыта");
  311. case 3:
  312. {
  313. ShowPlayerDialog(playerid, d_mp_gun, DIALOG_STYLE_LIST, "Выберите оружие", "Катана\n\
  314. Лопата\n\
  315. Дигл\n\
  316. AK-47\n\
  317. M4\n\
  318. Парашют", "Выбрать", "Отмена");
  319. }
  320. case 4:
  321. {
  322. new Float:x, Float:y, Float:z;
  323. GetPlayerPos(playerid,x,y,z);
  324. foreach(new i : Player)
  325. {
  326. if(i_mp[i] == 1) SetPlayerHealth(i, 100);
  327. return SendClientMessage(i, 0x539B63AA, "Администратор выдал вам жизни");
  328. }
  329. }
  330. case 5:
  331. {
  332. new Float:x, Float:y, Float:z;
  333. GetPlayerPos(playerid,x,y,z);
  334. foreach(new i : Player)
  335. {
  336. if(i_mp[i] == 1) SetPlayerArmour(i, 100);
  337. SetPlayerAttachedObject(playerid, 4, 373, 1, 0.286006,-0.038657,-0.158132, 67.128456,21.916156,33.972290, 1,1,1);
  338. return SendClientMessage(i, 0x539B63AA, "Администратор выдал вам броню");
  339. }
  340. }
  341. case 6:
  342. {
  343. new Float:x, Float:y, Float:z;
  344. GetPlayerPos(playerid,x,y,z);
  345. new team_clist = 0;
  346. foreach(new i : Player)
  347. {
  348. if(i_mp[i] == 1)
  349. {
  350. if(User_MP[i] == true) continue;
  351. if(team_clist == 1)
  352. {
  353. GetPlayerSkin(Player_Skin[i]);
  354. SetPlayerColor(i, 0xDC1010AA);
  355. team_clist = 0;
  356. Gamers_Team[i] = Create3DTextLabel("Красный",0xDC1010AA,0.0,0.0,1500.0,30.0,-1,0);
  357. Attach3DTextLabelToPlayer(Gamers_Team[i], playerid, 0.0, 0.0, 0.7);
  358. SetPlayerSkin(playerid, 28);
  359. }
  360. else
  361. {
  362. GetPlayerSkin(Player_Skin[i]);
  363. SetPlayerColor(i, 0x3F24DAAA);
  364. team_clist = 1;
  365. Gamers_Team[i] = Create3DTextLabel("Синий",0x3F24DAAA,0.0,0.0,1500.0,30.0,-1,0);
  366. Attach3DTextLabelToPlayer(Gamers_Team[i], playerid, 0.0, 0.0, 0.7);
  367. SetPlayerSkin(playerid, 30);
  368. }
  369. }
  370. }
  371. }
  372. case 7:
  373. {
  374. new Float:x, Float:y, Float:z;
  375. GetPlayerPos(playerid,x,y,z);
  376. foreach(new i : Player)
  377. {
  378. if(i_mp[i] == 1)
  379. {
  380. if(User_MP[i] == true) continue;
  381. ResetPlayerWeapons(i);
  382. SendClientMessage(i, 0x539B63AA, "Администратор забрал ваше оружие");
  383. }
  384. }
  385. }
  386. case 8:
  387. {
  388. new Float:x, Float:y, Float:z;
  389. GetPlayerPos(playerid,x,y,z);
  390. foreach(new i : Player)
  391. {
  392. if(i_mp[i] == 1)
  393. {
  394. if(User_MP[i] == true) continue;
  395. TogglePlayerControllable(i,0);
  396. SendClientMessage(i, 0x539B63AA, "Вы были заморожены администратором");
  397. }
  398. }
  399. }
  400. case 9:
  401. {
  402. new Float:x, Float:y, Float:z;
  403. GetPlayerPos(playerid,x,y,z);
  404. foreach(new i : Player)
  405. {
  406. if(i_mp[i] == 1)
  407. {
  408. if(User_MP[i] == true) continue;
  409. TogglePlayerControllable(i,1);
  410. SendClientMessage(i, 0x539B63AA, "Вы были разморожены администратором");
  411. }
  412. }
  413. }
  414. case 10:
  415. {
  416. // if(GetPVarInt(playerid, "AntiFlood") > gettime()) return SendClientMessage(playerid, -1, "Можно использовать раз в минуту");
  417. Timer_Number = SetTimer("@_Number_Start", 1000, 1);
  418. SetPVarInt(playerid, "AntiFlood", gettime() + 60);
  419. }
  420. case 11:
  421. {
  422. for(new i; i < New_Cars; i ++)
  423. {
  424. DestroyVehicle(car_ids[i]);
  425. }
  426. return SendClientMessage(playerid, 0x539B63AA, "Все машины удалены");
  427. }
  428. case 12:
  429. {
  430. ShowPlayerDialog(playerid, d_games, DIALOG_STYLE_LIST, "Мини игры", "1. Викторина\n2. Ответ на вопрос", "Выбрать","Отмена");
  431. }
  432. case 13:
  433. {
  434. if(tp_na_mp == 0) return tp_na_mp = 1; else return tp_na_mp = 0;
  435. }
  436. case 14:
  437. {
  438. foreach(new i : Player)
  439. {
  440. if(i_mp[i] == 1)
  441. {
  442. SetPlayerPos(i,i_MP_x[i],i_MP_y[i],i_MP_z[i]);
  443. SendClientMessage(i, 0x60BC63AA, "Администратор телепортировал вас на свое место");
  444. }
  445. }
  446. }
  447. case 15:
  448. {
  449. new Float:x, Float:y, Float:z;
  450. GetPlayerPos(playerid, x,y,z);
  451. new number_coord;
  452. foreach(new i : Player)
  453. {
  454. if(i_mp[i] == 1)
  455. {
  456. number_coord += 2;
  457. SetPlayerPos(i,x + number_coord,y,z);
  458. TogglePlayerControllable(i,0);
  459. }
  460. }
  461. SendClientMessage(playerid,0x60BC63AA, "Игроки построены и заморожены");
  462. }
  463. case 16:
  464. {
  465. foreach(new i : Player)
  466. {
  467. if(i_mp[i] == 1)
  468. {
  469. i_mp[i] = 0;
  470. SendClientMessage(playerid, 0x60BC63AA, "Вы были отключены от мероприятия администратором");
  471. }
  472. }
  473. }
  474. case 17:
  475. {
  476. ShowPlayerDialog(playerid, d_compl, DIALOG_STYLE_INPUT, " ","Введите id игрока а мы выведим его ник в общий чат","Принять","Отмена");
  477. }
  478. }
  479. }
  480. case d_open_mp:
  481. {
  482. if(response)
  483. {
  484. switch(listitem)
  485. {
  486. case 0:
  487. {
  488. if(Teleport_Info == 1) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт уже открыт");
  489. ShowPlayerDialog(playerid, d_open_mp_2, DIALOG_STYLE_INPUT, " ", "Введите максимальное кол-во участников. От 1 до 300", "Ввод", "Отмена");
  490. }
  491. case 1:
  492. {
  493. if(Teleport_Info == 1) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт уже открыт");
  494. GetPlayerPos(playerid, mpX, mpY, mpZ);
  495. Teleport_Info = 1;
  496. foreach(new i : Player)
  497. {
  498. TextDrawShowForPlayer(i,Mp_Open[0]);
  499. TextDrawShowForPlayer(i,Mp_Open[1]);
  500. TextDrawShowForPlayer(i,Mp_Open[2]);
  501. }
  502. SendClientMessageToAll(0x409961AA, "Внимание: открыт телепорт на мероприятие. /mp");
  503. new Name[24];
  504. GetPlayerName(playerid, Name, sizeof(Name));
  505. format(global_str, sizeof(global_str), "Телепорт на мероприятие {32A449}открыт.{FFFFFF}\nСоздатель: {3293A4}%s",Name);
  506. new Float:x,Float:y,Float:z;
  507. GetPlayerPos(playerid, x,y,z);
  508. text_mp = Create3DTextLabel(global_str, 0xFFFFFFFF, x,y,z, 40.0, -1 );
  509. return true;
  510. }
  511. case 2:
  512. {
  513. if(Teleport_Info == 0) return SendClientMessage(playerid, 0xFF0000AA, "Телепорт не открыт");
  514. Teleport_Info = 0;
  515. foreach(new i : Player)
  516. {
  517. TextDrawHideForPlayer(i,Mp_Open[0]);
  518. TextDrawHideForPlayer(i,Mp_Open[1]);
  519. TextDrawHideForPlayer(i,Mp_Open[2]);
  520. }
  521. Delete3DTextLabel(text_mp);
  522. cell_open_mp = 0;
  523. game_mp = 0;
  524. return SendClientMessageToAll(0x409961AA, "Внимание: телепорт на мероприятие {FF0000}закрыт");
  525. }
  526. }
  527. }
  528. }
  529. case d_open_mp_2:
  530. {
  531. if(response)
  532. {
  533. if(strval(inputtext) < 1 || strval(inputtext) > 300)
  534. {
  535. return ShowPlayerDialog(playerid, d_open_mp_2, DIALOG_STYLE_INPUT, " ", "Введите максимальное кол-во участников. От 1 до 300", "Ввод", "Отмена");
  536. }
  537. else
  538. {
  539. cell_open_mp = strval(inputtext);
  540. open_mp_status = 1;
  541.  
  542. GetPlayerPos(playerid, mpX, mpY, mpZ);
  543. Teleport_Info = 1;
  544. foreach(new i : Player)
  545. {
  546. TextDrawShowForPlayer(i,Mp_Open[0]);
  547. TextDrawShowForPlayer(i,Mp_Open[1]);
  548. TextDrawShowForPlayer(i,Mp_Open[2]);
  549. }
  550. new _str[140]; new Name[24];
  551. GetPlayerName(playerid, Name, sizeof(Name));
  552. format(_str, sizeof(_str), "Телепорт на мероприятие {32A449}открыт.{FFFFFF}. Кол-во свободных мест [%d]\nСоздатель: {3293A4}%s",cell_open_mp,Name);
  553. SendClientMessageToAll(0x409961AA, _str);
  554. SendClientMessageToAll(0x409961AA, "Для телепорта используйте /mp");
  555. new Float:x,Float:y,Float:z;
  556. GetPlayerPos(playerid, x,y,z);
  557. text_mp = CreateDynamic3DTextLabel(_str, 0xFFFFFFFF, x,y,z, 40.0, INVALID_PLAYER_ID,INVALID_PLAYER_ID,0,-1,-1,-1,100.0);
  558.  
  559. }
  560. }
  561. }
  562. case d_games:
  563. {
  564. switch(listitem)
  565. {
  566. case 0:
  567. {
  568. ShowPlayerDialog(playerid, d_games_1, DIALOG_STYLE_INPUT, "Мини игры", "Введите число от 1 до 999", "Ввод","Отмена");
  569. }
  570. case 1:
  571. {
  572. ShowPlayerDialog(playerid, v_games, DIALOG_STYLE_INPUT, "Мини игры", "Введите ваш вопрос. Максимум 100 символов.\n\nВажно: ответ на вопрос должен быть одним словом и без цифр", "Ввод","Отмена");
  573. }
  574. }
  575. }
  576. case v_games:
  577. {
  578. if(strval(inputtext) > 100 || strlen(inputtext) > 100) return ShowPlayerDialog(playerid, v_games, DIALOG_STYLE_INPUT, "Мини игры", "Введите ваш вопрос. Максимум 100 символов", "Ввод","Отмена");
  579. format(v_vopros, sizeof(v_vopros), "%s",strlen(inputtext));
  580. ShowPlayerDialog(playerid, v_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите ответ на вопрос. Максимум 20 символов", "Ввод","Отмена");
  581. }
  582. case v_games_2:
  583. {
  584. if(response)
  585. {
  586. if(strval(inputtext) > 20 || strval(inputtext) > 20) return ShowPlayerDialog(playerid, v_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите ответ на вопрос. Максимум 20 символов", "Ввод","Отмена");
  587. format(v_otvet, sizeof(v_otvet), "%s",strlen(inputtext));
  588. v_otvet_1 = strlen(inputtext);
  589. new string[256];
  590. format(string,sizeof(string), "Ваш вопрос: %s\nВаш ответ: %s\nЗапустить игру?",v_vopros,v_otvet);
  591. ShowPlayerDialog(playerid, v_open_games, DIALOG_STYLE_MSGBOX, " ", string, "Запуск","Отмена");
  592. }
  593. }
  594. case v_open_games:
  595. {
  596. if(response)
  597. {
  598. v_game = 1;
  599. new _str[144];
  600. format(_str,sizeof(_str), "[СЛОВА]: {FFFFFF}%s",v_vopros);
  601. SendClientMessageToAll(0x409961AA, _str);
  602. SendClientMessageToAll(0x409961AA, "Ответ писать в общий чат");
  603. }
  604. }
  605. case d_games_1:
  606. {
  607. if(response)
  608. {
  609. if(strval(inputtext) < 1 || strval(inputtext) > 999)
  610. {
  611. return ShowPlayerDialog(playerid, d_games_1, DIALOG_STYLE_INPUT, "Мини игры", "Введите число от 1 до 999", "Ввод","Отмена");
  612. }
  613. else
  614. {
  615. cell_1 = strval(inputtext);
  616. ShowPlayerDialog(playerid, d_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите второе число от 1 до 999", "Ввод","Отмена");
  617. }
  618. }
  619. }
  620. case d_games_2:
  621. {
  622. if(response)
  623. {
  624. if(strval(inputtext) < 1 || strval(inputtext) > 999)
  625. {
  626. return ShowPlayerDialog(playerid, d_games_2, DIALOG_STYLE_INPUT, "Мини игры", "Введите второе число от 1 до 999", "Ввод","Отмена");
  627. }
  628. else
  629. {
  630. cell_2 = strval(inputtext);
  631. new string[200];
  632. otvet_game = cell_1 + cell_2;
  633. format(string, sizeof(string), "{FFFFFF}Ваше первое число: {61B08E}%d\n{FFFFFF}Ваше второе число: {61B08E}%d\n\n{49DF9E}Итог: %d",cell_1, cell_2, otvet_game);
  634. ShowPlayerDialog(playerid, d_go_cell, DIALOG_STYLE_MSGBOX," ", string, "Запустить","Отмена");
  635. }
  636. }
  637. }
  638. case d_otvet:
  639. {
  640. if(response)
  641. {
  642. otvet = strval(inputtext);
  643. if(otvet == otvet_game)
  644. {
  645. new _str[256]; new Name[24];
  646. GetPlayerName(playerid, Name, sizeof(Name));
  647. format(_str, sizeof(_str), "{61B08E}[ВИКТОРИНА] {FFFFFF}Правильный ответ: {61B08E}%d. {FFFFFF}Ответил: {61B08E}%s",otvet_game,Name);
  648. SendClientMessageToAll(0xFFFFFFFF, _str);
  649. open_game = 0;
  650. }
  651. else return SendClientMessage(playerid, -1, "{FF0000}Неправильный ответ");
  652. }
  653. }
  654. case d_go_cell:
  655. {
  656. if(response)
  657. {
  658. new string[256];
  659. format(string,sizeof(string), "{6AB393}[ВИКТОРИНА] {FFFFFF}Сколько будет {6AB393}%d {FFFFFF}+ {6AB393}%d",cell_1, cell_2);
  660. SendClientMessageToAll(0xFFFFFFFF, string);
  661. new Name[24];
  662. GetPlayerName(playerid, Name, sizeof(Name));
  663. format(string, sizeof(string), "{6AB393}Администратор викторины: {FFFFFF}%s",Name);
  664. SendClientMessageToAll(0xFFFFFFFF, string);
  665. SendClientMessageToAll(0xFFFFFFFF, "{6AB393}Для ответа используйте /vot");
  666. open_game = 1;
  667. }
  668. }
  669. case d_compl:
  670. {
  671. if(strval(inputtext) < 0 || strval(inputtext) > 1000) return SendClientMessage(playerid, 0xFF0000AA, "Ид игрока должен быть от 1 до 1000");
  672. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000AA, "Игрока под данным ид нет в сети");
  673. new string[144]; new Name[24];
  674. GetPlayerName(strval(inputtext), Name, sizeof(Name));
  675. format(string,sizeof(string), "{4AB1BF}Внимание: {BCBCBC}Победителем мероприятия объявляется %s[%d]. Поздравляем.", Name,playerid);
  676. SendClientMessageToAll(0xFF0000AA, string);
  677. }
  678. case d_mpveh_id:
  679. {
  680. if(strval(inputtext) < 1 ||strval(inputtext) > 10)
  681. {
  682. return ShowPlayerDialog(playerid, d_mpveh_id, DIALOG_STYLE_INPUT, " ","Введите количество машин\n\nМинимум 1, максимум 10","Принять","Отмена");
  683. }
  684. count_veh = strval(inputtext);
  685. new string[200];
  686. format(string,sizeof(string), "Вы ввели %d символов", count_veh);
  687. SendClientMessage(playerid, -1, string);
  688. ShowPlayerDialog(playerid, d_mpveh, DIALOG_STYLE_INPUT, " ","Введите id машин","Принять","Отмена");
  689. }
  690. case d_mp_gun:
  691. {
  692. if(response)
  693. {
  694. new gun_id;
  695. switch(listitem)
  696. {
  697. case 0: gun_id = 8;
  698. case 1: gun_id = 6;
  699. case 2: gun_id = 24;
  700. case 3: gun_id = 30;
  701. case 4: gun_id = 31;
  702. case 5: gun_id = 46;
  703. }
  704. new Float:x, Float:y, Float:z;
  705. GetPlayerPos(playerid,x,y,z);
  706. new _string[124];
  707. if(gun_id == 8) format(_string, 124, "Администратор выдал вам катану");
  708. if(gun_id == 6) format(_string, 124, "Администратор выдал вам лопату");
  709. if(gun_id == 24) format(_string, 124, "Администратор выдал вам дигл");
  710. if(gun_id == 30) format(_string, 124, "Администратор выдал вам AK-47");
  711. if(gun_id == 31) format(_string, 124, "Администратор выдал вам M4");
  712. if(gun_id == 46) format(_string, 124, "Администратор выдал вам парашют");
  713. foreach(new i : Player)
  714. {
  715. if(IsPlayerInRangeOfPoint(i, 20.0, x, y, z)) return GivePlayerWeapon(i, gun_id, 300);
  716. SendClientMessage(i, 0x539B63AA, _string);
  717. }
  718. }
  719. }
  720. case d_mpveh:
  721. {
  722. if(strval(inputtext) < 400 || strval(inputtext) > 611)
  723. {
  724. return ShowPlayerDialog(playerid, d_mpveh, DIALOG_STYLE_INPUT, " ","Введите id машин","Принять","Отмена");
  725. }
  726. car_id = strval(inputtext);
  727. new Float:x,Float:y,Float:z, Float:Angle;
  728. GetPlayerFacingAngle(playerid, Angle);
  729. GetPlayerPos(playerid,x,y,z);
  730. new coord = 0;
  731. for(new i; i < count_veh; i ++)
  732. {
  733. coord += 10;
  734. New_Cars ++;
  735. car_ids[i] = CreateVehicle(car_id, x + coord, y, z, Angle, 0, 1, 60);
  736. }
  737. }
  738. }
  739. return true;
  740. }
  741. @_Number_Start();
  742. @_Number_Start()
  743. {
  744. switch(Leson_Timer)
  745. {
  746. case 0:
  747. {
  748. foreach(new i : Player)
  749. {
  750. for(new b; b < 3; b++)
  751. {
  752. TextDrawShowForPlayer(i, mp_number[b]);
  753. }
  754. PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
  755. }
  756. Leson_Timer ++;
  757. }
  758. case 1:
  759. {
  760. foreach(new i : Player)
  761. {
  762. TextDrawHideForPlayer(i, mp_number[2]);
  763. TextDrawShowForPlayer(i, mp_number[3]);
  764. PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
  765. }
  766. Leson_Timer ++;
  767. }
  768. case 2:
  769. {
  770. foreach(new i : Player)
  771. {
  772. TextDrawHideForPlayer(i, mp_number[3]);
  773. TextDrawShowForPlayer(i, mp_number[4]);
  774. PlayerPlaySound(i, 1056, 0.0, 0.0, 10.0);
  775. }
  776. Leson_Timer ++;
  777. }
  778. case 3:
  779. {
  780. foreach(new i : Player)
  781. {
  782. TextDrawHideForPlayer(i, mp_number[4]);
  783. TextDrawShowForPlayer(i, mp_number[5]);
  784. PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0);
  785. }
  786. Leson_Timer ++;
  787. }
  788. case 4:
  789. {
  790. foreach(new i : Player)
  791. {
  792. for(new b; b < 6; b ++)
  793. {
  794. TextDrawHideForPlayer(i, mp_number[b]);
  795. }
  796. }
  797. KillTimer(Timer_Number);
  798. Leson_Timer = 0;
  799. }
  800. }
  801. return true;
  802. }
  803. stock MP_Dostup(playerid)
  804. {
  805. new namep[MAX_PLAYER_NAME];
  806. new yes_no;
  807. new file = ini_openFile("Admin_MP.ini");
  808.  
  809. GetPlayerName(playerid, namep, sizeof(namep));
  810.  
  811. if(ini_getInteger(file, namep, yes_no) == 0)
  812. {
  813. switch(yes_no)
  814. {
  815. case 0: User_MP[playerid] = false;
  816. case 1: User_MP[playerid] = true;
  817. }
  818. }
  819. else if(IsPlayerAdmin(playerid)) User_MP[playerid] = true; else User_MP[playerid] = false;
  820. ini_closeFile(file);
  821. return true;
  822. }
  823. CMD:vot(playerid, params[])
  824. {
  825. if(open_game == 1)
  826. {
  827. ShowPlayerDialog(playerid, d_otvet, DIALOG_STYLE_INPUT, " ", "Введите ответ:", "Ввод","Отмена");
  828. }
  829. return true;
  830. }
  831. public OnPlayerText(playerid, text[])
  832. {
  833. if(v_game == 1)
  834. {
  835. if(strlen(text) == v_otvet_1)
  836. {
  837. new Name[24]; new str[144];
  838. GetPlayerName(playerid, Name, sizeof(Name));
  839. format(str, sizeof(str), "Правильный ответ: %s. Ответил: %s",v_otvet, Name);
  840. SendClientMessageToAll(0x61B08EAA,str);
  841. }
  842. }
  843. }
  844.  
  845. ______
  846.  
  847. Не забудьте создать файл Admin_MP.ini в папке scriptfiles !!!
  848. В нём указываете имена админов которые смогут создавать МП и управлять ими!
  849.  
  850. Например:
  851.  
  852. Vova_Ivanov = 1 ( обязательно ставьте "= 1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement