Advertisement
Guest User

Untitled

a guest
Dec 31st, 2013
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.55 KB | None | 0 0
  1. --LuaTribeManager [LTM]
  2. char = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","0","1","2","3","4","5","6","7","8","9"}
  3. math.randomseed(os.time())
  4. pass = {}
  5. function generate(s, l)
  6. pass = {}
  7.         size = math.random(s,l)
  8.  
  9.         for z = 1,size do
  10.  
  11.                 case = math.random(1)
  12.                 a = math.random(1,#char)
  13.                 if case == 1 then
  14.                         x=string.upper(char[a])
  15.                 elseif case == 2 then
  16.                         x=string.lower(char[a])
  17.                 end
  18.         table.insert(pass, x)
  19.         end
  20.         return(table.concat(pass))
  21. end
  22. function start()
  23. system.disableChatCommandDisplay("m#", true)
  24. generate(9,9);
  25. SuperAdmin={"Bushmeister"}
  26. admins={"Bushfight","Kbyjkbev","Bushmeister", "Krolko"}
  27. oj=20
  28. oj=oj*2
  29. rouF=-1
  30. rempver=-500
  31. proverenniy={"Bushmeister"}
  32. Banned={}
  33. mor="<font color='#2ECF73'>ON</font>"
  34. far=false
  35. faro="<font color='#CB546B'>OFF</font>"
  36. tear=false
  37. tea="<font color='#CB546B'>OFF</font>"
  38. xClick=000
  39. yClick=000
  40. info=false
  41. i={}
  42.  
  43. popu=true
  44. popuset="<font color='#2ECF73'>ON</font>"
  45.  
  46. pabla=0
  47. gafra=10
  48. ui.addPopup(42,0, "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>",nil,-5000,-900,10200)
  49. ui.addTextArea(41,"<p align='center'><a href='event:NOWAYBAY'><font size='40'><font color='#879efe'><b>Lua</font><font color='#ffd667'>TribeManager</font></font></b></a></p>",nil,200,200,400,nil,nil,0x324650,99999999,true)
  50. function textarea(player,msg)
  51. ui.addTextArea(77777,"<p align='center'><a href='event:close'> <font size='11'>"..msg.."</font></p></a>",player,6,368,800,30,0x1C3C41,0x1C3C41,0.7,true)
  52. end
  53. textt="<font color='#CB546B'>Администраторы: </font><font color='#ED67EA'>"..table.concat(admins, ", ").."</font>"
  54. textarea(player,textt)
  55. for name,player in pairs(tfm.get.room.playerList) do
  56. i[name]=0
  57. end
  58. ralF={4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070}
  59. function eventNewPlayer(playerName)
  60. for name,player in pairs(tfm.get.room.playerList) do
  61. i[name]=0
  62. end
  63. system.bindMouse(playerName, true)
  64. tfm.exec.bindKeyboard(playerName, 32, true, true)
  65. tfm.exec.bindKeyboard(playerName, 80, true, true)
  66. tfm.exec.bindKeyboard(playerName, 72, true, true)
  67. end
  68. function eventKeyboard(playerName, keyCode, down, xPosition, yPosition)
  69. if far==true then
  70. if keyCode==32 then
  71. tfm.exec.movePlayer(playerName,0,0,true,0,-50,false)
  72. end
  73. end
  74. for _,recv in pairs (admins) do
  75.     if (recv == playerName) then
  76.     if keyCode==80 then
  77.     ui.addTextArea(401,"<p align='center'><a href='event:plusik'><b>+</b></a></p>",recv,22,36,53,16,nil,0x324650,nil,true)
  78.     end
  79.     end
  80.     end
  81.     for _,govno in pairs (SuperAdmin) do
  82.     if (govno == playerName) then
  83.     if keyCode==80 then
  84.     ui.addTextArea(401,"<p align='center'><a href='event:plusik'><b>+</b></a></p>",govno,22,36,53,16,nil,0x324650,nil,true)
  85.     end
  86.     end
  87.     end
  88.     for _,recv in pairs (admins) do
  89.     if (recv == playerName) then
  90.     if keyCode==72 then
  91.     ui.addTextArea(403,"| Пароль: |<p align='center'><a href='event:parol'><b>"..table.concat(pass).."</b></a></p>",recv,628,363,153,20,nil,0x324650,nil,true)
  92. rouF=oj
  93. end
  94. end
  95. end
  96. for _,govno in pairs (SuperAdmin) do
  97.     if (govno == playerName) then
  98.     if keyCode==72 then
  99.     ui.addTextArea(403,"| Пароль: |<p align='center'><a href='event:parol'><b>"..table.concat(pass).."</b></a></p>",govno,628,363,153,20,nil,0x324650,nil,true)
  100. rouF=oj
  101. end
  102. end
  103. end
  104. end
  105. idd=ralF[math.random(#ralF)]
  106. function eventMouse(playerName, xC, yC)
  107. if tear==true then
  108. tfm.exec.movePlayer(playerName, xC, yC, false, 0, 0, false)
  109. end
  110. if info==true then
  111. xClick=xC
  112. yClick=yC
  113. ui.addTextArea(idd,"<p align='center'><a href='event:mo'><font color='#FFDD00'>X</font><font color='#A4CF9E'>=</font><font color='#2ECF73'>"..xClick.."</font> <font color='#FFDD00'>Y</font><font color='#A4CF9E'>=</font><font color='#2ECF73'>"..yClick.."</font><b></b></a></p>",playerName,xC+10,yC-5,nil,20,nil,0x324650,nil,true)
  114. gord=10
  115. end
  116. end
  117. function eventChatCommand(playerName, message)
  118. local args={}
  119. for _,recv in pairs (admins) do
  120.     if (recv == playerName) then
  121.    
  122.  
  123.         for argument in message:gmatch("[^#]+") do
  124.             table.insert(args,argument)
  125.         end
  126. if args[1]=="chat" and args[2] then
  127. end
  128. if args[1]=="m" and args[2] then
  129. textarea(player,"<font color='#ED67EA'>[~Modération] "..args[2].."</font>")
  130. end
  131. if message=="panel" then
  132. ui.addTextArea(401,"<p align='center'><a href='event:plusik'><b>+</b></a></p>",playerName,22,36,53,16,nil,0x324650,nil,true)
  133. end
  134. if message=="arg" then
  135. print(arg[#arg])
  136. end
  137. if message=="pass" then
  138. ui.addTextArea(403,"| Пароль: |<p align='center'><a href='event:parol'><b>"..table.concat(pass).."</b></a></p>",playerName,628,363,153,20,nil,0x324650,nil,true)
  139. rouF=oj
  140. end
  141. if message=="banlist" then
  142. print(Banned[#Banned])
  143. end
  144.     end
  145.     end
  146.     end
  147. function eventTextAreaCallback(id,name,callback)
  148. if callback=="mo" then
  149. ui.removeTextArea(idd,name)
  150. end
  151. if callback == "close" then
  152. ui.removeTextArea(77777,name)
  153. end
  154. keyinvoker = name
  155. if callback=="plusik" then
  156. if table.contains(proverenniy, keyinvoker) == false then
  157. ui.addPopup(1,2, "Введите пароль для доступа к функциям администратора",name,300,150,200)
  158. elseif table.contains(proverenniy, keyinvoker) == true then
  159. ui.removeTextArea(401, name)
  160. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  161. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",name,92,36,83,16,nil,0x324650,nil,true)
  162. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",name,192,36,83,16,nil,0x324650,nil,true)
  163. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",name,292,36,83,16,nil,0x324650,nil,true)
  164. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",name,392,36,83,16,nil,0x324650,nil,true)
  165. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",name,492,36,73,16,nil,0x324650,nil,true)
  166. end
  167. end
  168. if callback=="sir" then
  169. ui.addPopup(2,2, "  <font color='#A4CF9E'>Введите что Вы хотите дать и кому</font><br>             <font color='#BABD2F'>Доступные команды:</font><br>                   <font color='#2ECF73'>cheese</font> <font color='#BABD2F'>Nick</font><br>                  <font color='#2ECF73'>vampire</font> <font color='#BABD2F'>Nick</font><br>                  <font color='#2ECF73'>shaman</font> <font color='#BABD2F'>Nick</font><br>                   <font color='#2ECF73'>victory</font> <font color='#BABD2F'>Nick</font><br><font size='9'><font color='#CB546B'>*Никнейм обязательно вводить с большой буквы (Пример:cheese Bushmeister)</font></font>",name,300,150,240)
  170. end
  171. if callback=="minus" then
  172. ui.removeTextArea(401, name)
  173. ui.removeTextArea(402, name)
  174. ui.removeTextArea(404, name)
  175. ui.removeTextArea(405, name)
  176. ui.removeTextArea(406, name)
  177. ui.removeTextArea(407, name)
  178. ui.addTextArea(401,"<p align='center'><a href='event:plusik'><b>+</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  179. --remove
  180. end
  181. if callback=="карта" then
  182. ui.removeTextArea(401, name)
  183. ui.removeTextArea(402, name)
  184. ui.removeTextArea(404, name)
  185. ui.removeTextArea(405, name)
  186. ui.removeTextArea(406, name)
  187. ui.removeTextArea(407, name)
  188. ui.addTextArea(03,"<p align='center'><a href='event:назад'><b>Назад</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  189. ui.addTextArea(04,"<p align='center'><a href='event:изменить карту'><b>Изменить карту</b></a></p>",name,92,36,113,16,nil,0x324650,nil,true)
  190. ui.addTextArea(05,"<p align='center'><a href='event:изменить название'><b>Изменить название</b></a></p>",name,222,36,133,16,nil,0x324650,nil,true)
  191. ui.addTextArea(06,"<p align='center'><a href='event:изменить время'><b>Изменить время</b></a></p>",name,372,36,133,16,nil,0x324650,nil,true)
  192. end
  193. if callback=="назад" then
  194. ui.removeTextArea(03, name)
  195. ui.removeTextArea(04, name)
  196. ui.removeTextArea(05, name)
  197. ui.removeTextArea(06, name)
  198. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  199. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",name,92,36,83,16,nil,0x324650,nil,true)
  200. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",name,192,36,83,16,nil,0x324650,nil,true)
  201. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",name,292,36,83,16,nil,0x324650,nil,true)
  202. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",name,392,36,83,16,nil,0x324650,nil,true)
  203. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",name,492,36,73,16,nil,0x324650,nil,true)
  204. end
  205. if callback=="изменить карту" then
  206. ui.addPopup(3,2, "<br><p align='center'><b>Введите @номер карты</b></p>",name,300,150,200)
  207. end
  208. if callback=="изменить название" then
  209. ui.addPopup(4,2, "<br><p align='center'><b>Введите название карты</b></p>",name,300,150,200)
  210. end
  211. if callback=="изменить время" then
  212. ui.addPopup(5,2, "<br><p align='center'><b>Введите время раунда в секундах</b></p>",name,300,150,200)
  213. end
  214. if callback=="игрок" then
  215. ui.removeTextArea(401, name)
  216. ui.removeTextArea(402, name)
  217. ui.removeTextArea(404, name)
  218. ui.removeTextArea(405, name)
  219. ui.removeTextArea(406, name)
  220. ui.removeTextArea(407, name)
  221. ui.addTextArea(07,"<p align='center'><a href='event:назадигрок'><b>Назад</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  222. ui.addTextArea(08,"<p align='center'><a href='event:цвет'><b>Цвет никнейма</b></a></p>",name,92,36,113,16,nil,0x324650,nil,true)
  223. ui.addTextArea(09,"<p align='center'><a href='event:убить'><b>Убить</b></a></p>",name,222,36,83,16,nil,0x324650,nil,true)
  224. ui.addTextArea(010,"<p align='center'><a href='event:телепорт'><b>Телепортировать</b></a></p>",name,322,36,133,16,nil,0x324650,nil,true)
  225. end
  226. if callback=="цвет" then
  227. ui.addPopup(6,2, "<br><p align='center'><b>Введите никнейм и код цвета.</b></p><br><font size='9'><font color='#CB546B'>*Код цвета должен быть без # (Пример:Bushmeister FF9500)</font></font>",name,300,150,200)
  228. end
  229. if callback=="убить" then
  230. ui.addPopup(7,2, "<br><p align='center'><b>Введите никнейм игрока которого хотите убить.</b></p>",name,300,150,200)
  231. end
  232. if callback=="телепорт" then
  233. ui.addPopup(8,2, "<br><p align='center'><b>Введите никнейм игрока и x y координаты.</b></p>",name,300,150,200)
  234. end
  235. if callback=="бан" then
  236. ui.addPopup(9,2, "<br><p align='center'><b>Введите никнейм игрока и причину.<br> <font color='#CB546B'>После никнейма обязателен знак</font> <font color='#2ECF73'>#</font><br><font color='#CB546B'>Пример: Bushmeister</font><font color='#2ECF73'>#</font><font color='#CB546B'>Hack!</font></b></p>",name,300,150,200)
  237. end
  238. if callback=="разбан" then
  239. ui.addPopup(10,2, "<br><p align='center'><b>Введите никнейм игрока.</b></p>",name,300,150,200)
  240. end
  241. if callback=="назадигрок" then
  242. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  243. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",name,92,36,83,16,nil,0x324650,nil,true)
  244. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",name,192,36,83,16,nil,0x324650,nil,true)
  245. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",name,292,36,83,16,nil,0x324650,nil,true)
  246. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",name,392,36,83,16,nil,0x324650,nil,true)
  247. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",name,492,36,73,16,nil,0x324650,nil,true)
  248. ui.removeTextArea(07, name)
  249. ui.removeTextArea(08, name)
  250. ui.removeTextArea(09, name)
  251. ui.removeTextArea(010, name)
  252. end
  253. if callback=="другое" then
  254. ui.removeTextArea(401, name)
  255. ui.removeTextArea(402, name)
  256. ui.removeTextArea(404, name)
  257. ui.removeTextArea(405, name)
  258. ui.removeTextArea(406, name)
  259. ui.removeTextArea(407, name)
  260. ui.addTextArea(013,"<p align='center'><a href='event:назаддругое'><b>Назад</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  261. ui.addTextArea(014,"<p align='center'><a href='event:snow'><b>Снег</b></a></p>",name,92,36,53,16,nil,0x324650,nil,true)
  262. ui.addTextArea(015,"<p align='center'><a href='event:скилы'><b>Умения шамана: "..mor.."</b></a></p>",name,162,36,153,16,nil,0x324650,nil,true)
  263. ui.addTextArea(016,"<p align='center'><a href='event:фли'><b>Fly: "..faro.."</b></a></p>",name,332,36,73,16,nil,0x324650,nil,true)
  264. ui.addTextArea(017,"<p align='center'><a href='event:телепортак'><b>Телепортация: "..tea.."</b></a></p>",name,422,36,153,16,nil,0x324650,nil,true)
  265. ui.addTextArea(018,"<p align='center'><a href='event:добъект'><b>Добавить объект</b></a></p>",name,592,36,143,16,nil,0x324650,nil,true)
  266. end
  267. if callback=="snow" then
  268. ui.addPopup(11,2, "<br><p align='center'><b>Введите <font color='#2ECF73'>время</font> которое будет идти снег<br> (<font color='#2ECF73'>в секундах</font>) и <font color='#2ECF73'>силу</font> снежков(стандартная - 10)</b></p><font color='#CB546B'><font size='9'>Пример: 60 12</font></font>",name,300,150,200)
  269. end
  270. if callback=="скилы" then
  271. if mor=="<font color='#2ECF73'>ON</font>" then
  272. mor="<font color='#CB546B'>OFF</font>"
  273. tfm.exec.disableAllShamanSkills(true)
  274. textarea(player,"<font color='#ED67EA'>Skills:</font><font color='#CB546B'> OFF</font>")
  275. ui.removeTextArea(015, name)
  276. ui.addTextArea(015,"<p align='center'><a href='event:скилы'><b>Умения шамана:"..mor.."</b></a></p>",name,162,36,153,16,nil,0x324650,nil,true)
  277. elseif mor=="<font color='#CB546B'>OFF</font>" then
  278. mor="<font color='#2ECF73'>ON</font>"
  279. tfm.exec.disableAllShamanSkills(false)
  280. textarea(player,"<font color='#ED67EA'>Skills:</font><font color='#2ECF73'> ON</font>")
  281. ui.removeTextArea(015, name)
  282. ui.addTextArea(015,"<p align='center'><a href='event:скилы'><b>Умения шамана:"..mor.."</b></a></p>",name,162,36,153,16,nil,0x324650,nil,true)
  283. end
  284. end
  285. if callback=="фли" then
  286. if far==false then
  287. far=true
  288. faro="<font color='#2ECF73'>ON</font>"
  289. textarea(player,"<font color='#ED67EA'>Fly:</font><font color='#2ECF73'> ON</font>")
  290. dor();
  291. ui.removeTextArea(016, name)
  292. ui.addTextArea(016,"<p align='center'><a href='event:фли'><b>Fly: "..faro.."</b></a></p>",name,332,36,73,16,nil,0x324650,nil,true)
  293. elseif far==true then
  294. far=false
  295. faro="<font color='#CB546B'>OFF</font>"
  296. textarea(player,"<font color='#ED67EA'>Fly:</font><font color='#CB546B'> OFF</font>")
  297. dor();
  298. ui.removeTextArea(016, name)
  299. ui.addTextArea(016,"<p align='center'><a href='event:фли'><b>Fly: "..faro.."</b></a></p>",name,332,36,73,16,nil,0x324650,nil,true)
  300. end
  301. end
  302. if callback=="телепортак" then
  303. if tear==false then
  304. tear=true
  305. textarea(player,"<font color='#ED67EA'>Teleport:</font><font color='#2ECF73'> ON</font>")
  306. tea="<font color='#2ECF73'>ON</font>"
  307. ui.removeTextArea(017, name)
  308. ui.addTextArea(017,"<p align='center'><a href='event:телепортак'><b>Телепортация: "..tea.."</b></a></p>",name,422,36,153,16,nil,0x324650,nil,true)
  309. dor();
  310. elseif tear==true then
  311. tear=false
  312. tea="<font color='#CB546B'>OFF</font>"
  313. textarea(player,"<font color='#ED67EA'>Teleport:</font><font color='#CB546B'> OFF</font>")
  314. ui.removeTextArea(017, name)
  315. ui.addTextArea(017,"<p align='center'><a href='event:телепортак'><b>Телепортация: "..tea.."</b></a></p>",name,422,36,153,16,nil,0x324650,nil,true)
  316. dor();
  317. end
  318. end
  319. if callback=="добъект" then
  320. ui.addPopup(12,2, "<br><p align='center'><b>Введите id объекта и X Y координаты.</b></p>",name,300,150,200)
  321. ui.addPopup(00889,0, "<p align='center'><b>Список объектов:</p></b><br><p align='left'>ID   27   оранжевый портал<br>ID   28   шарик<br>ID   32   руна<br>ID   34   снег<br>ID   35   стрелка Валентина<br>ID   39   яблоко<br>ID   40   овчека<br>ID   45   ледяная палка<br>ID   46   шоколадная палка<br>ID   57   облако<br>ID   59   пузырь<br>ID   60   крошечная палка<br>ID   61   компаньон-куб<br>ID   62   стабильная руна</p>",name,510,90,200)
  322. ui.addPopup(00888,0, "<p align='center'><b>Список объектов:</p></b><br><p align='left'>ID   0   стрелка<br>ID   1   маленький ящик<br>ID   2   большой ящик<br>ID   3   маленькая палка<br>ID   4   большая палка<br>ID   6   мячик<br>ID   7   трамплин<br>ID   10   наковальня<br>ID   18   ядро вниз<br>ID   19   ядро вправо<br>ID   20   ядро влево<br>ID   23   бомба<br>ID   24   спирит<br>ID   26   голубой портал</p>",name,90,90,200)
  323. end
  324. if callback=="назаддругое" then
  325. alfazet=0
  326. ui.removeTextArea(013, name)
  327. ui.removeTextArea(014, name)
  328. ui.removeTextArea(015, name)
  329. ui.removeTextArea(016, name)
  330. ui.removeTextArea(017, name)
  331. ui.removeTextArea(018, name)
  332. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  333. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",name,92,36,83,16,nil,0x324650,nil,true)
  334. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",name,192,36,83,16,nil,0x324650,nil,true)
  335. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",name,292,36,83,16,nil,0x324650,nil,true)
  336. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",name,392,36,83,16,nil,0x324650,nil,true)
  337. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",name,492,36,73,16,nil,0x324650,nil,true)
  338. end
  339. if callback=="админ" then
  340. ui.removeTextArea(401, name)
  341. ui.removeTextArea(402, name)
  342. ui.removeTextArea(404, name)
  343. ui.removeTextArea(405, name)
  344. ui.removeTextArea(406, name)
  345. ui.removeTextArea(407, name)
  346. ui.addTextArea(019,"<p align='center'><a href='event:назададмин'><b>Назад</b></a></p>",name,22,36,53,17,nil,0x324650,nil,true)
  347. ui.addTextArea(020,"<p align='center'><a href='event:папуп'><b>ui.addPopup() "..popuset.."</b></a></p>",name,92,36,133,17,nil,0x324650,nil,true)
  348. ui.addTextArea(021,"<p align='center'><a href='event:месаге'><b>Message</b></a></p>",name,242,36,85,17,nil,0x324650,nil,true)
  349. ui.addTextArea(011,"<p align='center'><a href='event:бан'><b>Забанить</b></a></p>",name,347,36,100,16,nil,0x324650,nil,true)
  350. ui.addTextArea(012,"<p align='center'><a href='event:разбан'><b>Разбанить</b></a></p>",name,469,36,100,16,nil,0x324650,nil,true)
  351. for _,govno in pairs (SuperAdmin) do
  352.     if (govno == name) then
  353.     ui.addTextArea(022,"<p align='center'><a href='event:Добавить админа'><b><font color='#FFDD00'>Добавить админа</font></b></a></p>",name,22,78,133,17,nil,0x324650,nil,true)
  354.     ui.addTextArea(023,"<p align='center'><a href='event:удалить админа'><b><font color='#FFDD00'>Удалить админа</font></b></a></p>",name,173,78,130,17,nil,0x324650,nil,true)
  355.     ui.addTextArea(024,"<p align='center'><a href='event:инфо'><b><font color='#FFDD00'>Info</font></b></a></p>",name,323,78,53,17,nil,0x324650,nil,true)
  356.     ui.addTextArea(025,"<p align='center'><a href='event:попустройки'><b><font color='#FFDD00'>Popup: "..popuset.."</font></b></a></p>",name,397,78,83,17,nil,0x324650,nil,true)
  357.         ui.addTextArea(026,"<p align='center'><a href='event:рестарт'><b><font color='#FFDD00'>Restart</font></b></a></p>",name,500,78,73,17,nil,0x324650,nil,true)
  358.     end
  359.     end
  360. end
  361. if callback=="папуп" then
  362. if popu==true then
  363. ui.addPopup(13,2, "<p align='center'><b>Введите текст таблички и X Y координаты.<br><font color='#CB546B'>ВНИМАНИЕ!</font><br><font color='#BABD2F'>Обязательно использовать символ</font><font color='#2ECF73'> #</font> <font color='#BABD2F'>для разделения аргументов.</font></p><p align='left'><font color='#CB546B'>Пример:</font><font color='#2ECF73'>Текст </font><font color='#BABD2F'>#</font><font color='#2ECF73'>400</font><font color='#BABD2F'>#</font><font color='#2ECF73'>200</font></b></p>",name,300,150,200)
  364. end
  365. end
  366. if callback=="месаге" then
  367. ui.addPopup(14,2, "<br><p align='center'><b>Введите текст сообщения</b></p>",name,300,150,200)
  368. end
  369. if callback=="Добавить админа" then
  370. ui.addPopup(15,2, "<br><p align='center'><b>Введите никнейм нового админа</p>",name,300,150,200)
  371. end
  372. if callback=="удалить админа" then
  373. ui.addPopup(16,2, "<br><p align='center'><b>Введите никнейм админа и причину</b> <font size='9'>(необязательно)</font></p><p align='left'><font color='#CB546B'><font size='9'>*Предел 10 слов</font></font></p>",name,300,150,200)
  374. end
  375. if callback=="инфо" then
  376. if info==false then
  377. info=true
  378. textarea(player,"<font color='#ED67EA'>Info:</font><font color='#2ECF73'> ON</font>")
  379. elseif info==true then
  380. info=false
  381. textarea(player,"<font color='#ED67EA'>Info:</font><font color='#CB546B'> OFF</font>")
  382. ui.removeTextArea(idd)
  383. end
  384. end
  385. if callback=="попустройки" then
  386. if popu==true then
  387. popu=false
  388. popuset="<font color='#CB546B'>OFF"
  389. ui.removeTextArea(020, name)
  390. ui.addTextArea(020,"<p align='center'><a href='event:папуп'><b>ui.addPopup() "..popuset.."</b></a></p>",name,92,36,133,17,nil,0x324650,nil,true)
  391. for _,govno in pairs (SuperAdmin) do
  392.     if (govno == name) then
  393.     ui.removeTextArea(025,name)
  394.         ui.addTextArea(025,"<p align='center'><a href='event:попустройки'><b><font color='#FFDD00'>Popup: "..popuset.."</font></font></b></a></p>",name,397,78,83,17,nil,0x324650,nil,true)
  395.         end
  396.         end
  397. elseif
  398. popu==false then
  399. popu=true
  400. popuset="<font color='#2ECF73'>ON"
  401. ui.removeTextArea(020, name)
  402. ui.addTextArea(020,"<p align='center'><a href='event:папуп'><b>ui.addPopup() "..popuset.."</b></a></p>",name,92,36,133,17,nil,0x324650,nil,true)
  403. for _,govno in pairs (SuperAdmin) do
  404.     if (govno == name) then
  405.         ui.removeTextArea(025,name)
  406.         ui.addTextArea(025,"<p align='center'><a href='event:попустройки'><b><font color='#FFDD00'>Popup: "..popuset.."</font></b></a></p>",name,397,78,83,17,nil,0x324650,nil,true)
  407. end
  408. end
  409. end
  410. end
  411. if callback=="рестарт" then
  412. ui.addPopup(17,1, "<br><p align='center'><b>Перезапустить скрипт?</p>",name,300,150,200)
  413. ui.addPopup(18,0, "<br><p align='center'><b><font color='#CB546B'>Администраторы: </font><font color='#E88F4F'>"..admn.."</font><font color='#CB546B'><br>SuperAdmin: </font><font color='#E88F4F'>"..sadmn.."</font></p>",name,300,250,200)
  414. end
  415. if callback=="назададмин" then
  416. for _,govno in pairs (SuperAdmin) do
  417.     if (govno == name) then
  418.     ui.removeTextArea(022,name)
  419.     ui.removeTextArea(023,name)
  420.     ui.removeTextArea(024,name)
  421.     ui.removeTextArea(025,name)
  422.     ui.removeTextArea(026,name)
  423.     end
  424.     end
  425.     ui.removeTextArea(011, name)
  426.     ui.removeTextArea(012, name)
  427. ui.removeTextArea(019, name)
  428. ui.removeTextArea(020, name)
  429. ui.removeTextArea(021, name)
  430. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",name,22,36,53,16,nil,0x324650,nil,true)
  431. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",name,92,36,83,16,nil,0x324650,nil,true)
  432. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",name,192,36,83,16,nil,0x324650,nil,true)
  433. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",name,292,36,83,16,nil,0x324650,nil,true)
  434. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",name,392,36,83,16,nil,0x324650,nil,true)
  435. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",name,492,36,73,16,nil,0x324650,nil,true)
  436. end
  437. end
  438. gav={"ste"}
  439. function eventPopupAnswer(id,playerName,answer)
  440. local arg={}
  441. local rabbit={}
  442.  
  443.         for argument in answer:gmatch("[^%s]+") do
  444.             table.insert(arg,argument)
  445.         end
  446.         for argument in answer:gmatch("[^#]+") do
  447.             table.insert(rabbit,argument)
  448.         end
  449. if id==1 then
  450. if answer==table.concat(pass) then
  451. table.insert(proverenniy, playerName)
  452. ui.removeTextArea(401, playerName)
  453. ui.addTextArea(401,"<p align='center'><a href='event:minus'><b>-</b></a></p>",playerName,22,36,53,16,nil,0x324650,nil,true)
  454. ui.addTextArea(402,"<p align='center'><a href='event:sir'><b>Дать..</b></a></p>",playerName,92,36,83,16,nil,0x324650,nil,true)
  455. ui.addTextArea(404,"<p align='center'><a href='event:карта'><b>Карта..</b></a></p>",playerName,192,36,83,16,nil,0x324650,nil,true)
  456. ui.addTextArea(405,"<p align='center'><a href='event:игрок'><b>Игрок..</b></a></p>",playerName,292,36,83,16,nil,0x324650,nil,true)
  457. ui.addTextArea(406,"<p align='center'><a href='event:другое'><b>Другое..</b></a></p>",playerName,392,36,83,16,nil,0x324650,nil,true)
  458. ui.addTextArea(407,"<p align='center'><a href='event:админ'><b>Admin</b></a></p>",playerName,492,36,73,16,nil,0x324650,nil,true)
  459. ui.addTextArea(02,"<p align='center'><a href='event:AGHненужно'><b>Разблокировано!</b></a></p>",playerName,330,206,123,16,nil,0x324650,nil,true)
  460. rempver=5
  461. else
  462. print("<R>Неверный пароль!")
  463. end
  464. end
  465. if id==2 then
  466. if arg[1]=="cheese" and arg[2] then
  467. tfm.exec.giveCheese(arg[2])
  468. end
  469. if arg[1]=="vampire" and arg[2] then
  470. tfm.exec.setVampirePlayer(arg[2])
  471. end
  472. if arg[1]=="shaman" and arg[2] then
  473. tfm.exec.setShaman(arg[2])
  474. end
  475. if arg[1]=="victory" and arg[2] then
  476. tfm.exec.playerVictory(arg[2])
  477. end
  478. end
  479. if id==3 then
  480. if arg[1] then
  481.     if arg[1]==nil then
  482.     else
  483.     tfm.exec.newGame(arg[1])
  484.     end
  485. end
  486. end
  487. if id==4 then
  488. if rabbit[1] then
  489.     if rabbit[1]==nil then
  490.     else
  491.     tfm.exec.setUIMapName(rabbit[1])
  492.     end
  493. end
  494. end
  495. if id==5 then
  496. if arg[1] then
  497.     if arg[1]==nil then
  498.     else
  499.     tfm.exec.setGameTime(arg[1])
  500.     end
  501. end
  502. end
  503. if id==6 then
  504. if arg[1]==nil then
  505. else
  506. tfm.exec.setNameColor(arg[1], "0x"..arg[2])
  507. end
  508. end
  509. if id==7 then
  510. if arg[1] then
  511.     if arg[1]==nil then
  512.     else
  513.     tfm.exec.killPlayer(arg[1])
  514.     end
  515. end
  516. end
  517. if id==8 then
  518. if arg[1] then
  519.     if arg[1]==nil then
  520.     else
  521.     tfm.exec.movePlayer(arg[1], arg[2], arg[3])
  522. end
  523. end
  524. end
  525. if id==9 then
  526. if rabbit[1] and rabbit[2] then
  527.     if rabbit[1]==nil then
  528.     else
  529.     textarea(player,"<font color='#CB546B'>"..rabbit[1].."</font><font color='#BABD2F'> забанен. Причина: </font><font color='#CB546B'>"..rabbit[2].."</font>")
  530.     table.insert(Banned,rabbit[1])
  531.     ui.addPopup(005,0, "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>",rabbit[1],-5000,-900,10200)
  532.     ui.addPopup(006,0, "<br><p align='center'>Вы были забанены<br>Причина: <font color='#CB546B'>"..rabbit[2].."</p></font>",rabbit[1],300,150,200)
  533. end
  534. end
  535. end
  536. if id==10 then
  537. if arg[1] then
  538.     if arg[1]==nil then
  539.     else
  540.     table.rem(Banned,arg[1])
  541.     ui.addPopup(005,0, "0",arg[1],-5000,-900,10200)
  542.     end
  543.     end
  544.     end
  545.     if id==11 then
  546. if arg[1] then
  547.     if arg[1]==nil then
  548.     else
  549.     tfm.exec.snow(arg[1], arg[2])
  550.     end
  551.     end
  552.     end
  553. if id==12 then
  554. ui.addPopup(00888,0, "<br><p align='center'><b>0</b></p>",playerName,-2000,-5000,200)
  555. ui.addPopup(00889,0, "<br><p align='center'><b>0</b></p>",playerName,-2000,-5000,200)
  556. if arg[1] then
  557.     if arg[1]==nil then
  558.     else
  559.     tfm.exec.addShamanObject(arg[1], arg[2], arg[3],nil,nil,nil, arg[4])
  560.     end
  561.     end
  562.     end
  563. if id==13 then
  564. if arg[1] then
  565.     if arg[1]==nil then
  566.     else
  567. for name,player in pairs(tfm.get.room.playerList) do
  568. pabla=ralF[math.random(#ralF)]
  569. ui.addPopup(pabla,0, "<p align='center'><b>"..rabbit[1].."</b></p>",name,rabbit[2],rabbit[3],150)
  570.     end
  571.     end
  572. end
  573. end
  574. if id==14 then
  575. if arg[1] then
  576.     if arg[1]==nil then
  577.     else
  578.     textarea(player,"<font color='#ED67EA'>[~Modération] "..rabbit[1].."</font>")
  579.     end
  580.     end
  581. end
  582. if id==15 then
  583. if arg[1] then
  584.     if arg[1]==nil then
  585.     else
  586.     table.insert(admins,arg[1])
  587.         textarea(player,"<font color='#BABD2F'>Приветствуем нового администратора - </font><font color='#ED67EA'>"..arg[1].."!</font>")
  588.     end
  589.     end
  590. end
  591. if id==16 then
  592. if arg[1] then
  593.     if arg[1]==nil then
  594.     else
  595.     if arg[2]==nil then
  596.     table.rem(admins,arg[1])
  597.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font>")
  598.     else
  599.     if arg[3]==nil then
  600.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2])
  601.     else
  602.     if arg[4]==nil then
  603.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3])
  604.     else
  605.     if arg[5]==nil then
  606.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4])
  607.     else
  608.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5])
  609.     if arg[6]==nil then
  610.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5])
  611.     else
  612.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6])
  613.     if arg[7]==nil then
  614.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6])
  615.     else
  616.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7])
  617.     if arg[8]==nil then
  618.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7])
  619.     else
  620.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8])
  621.     if arg[9]==nil then
  622.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8])
  623.     else
  624.     if arg[10]==nil then
  625.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8].." "..arg[9])
  626.     else
  627.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8].." "..arg[9].." "..arg[10])
  628.     if arg[11]==nil then
  629.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8].." "..arg[9].." "..arg[10])
  630.     else
  631.     textarea(player,"<font color='#ED67EA'>"..arg[1].."</font><font color='#BABD2F'> больше не администратор!</font> <font color='#CB546B'>Причина:</font> <font color='#BABD2F'>"..arg[2].." "..arg[3].." "..arg[4].." "..arg[5].." "..arg[6].." "..arg[7].." "..arg[8].." "..arg[9].." "..arg[10].." "..arg[11])
  632.     end
  633.     end
  634.     end
  635.     end
  636.     end
  637.     end
  638.     end
  639.     end
  640.     end
  641.     end
  642.     end
  643.     end
  644. end
  645. if id==17 then
  646. if answer=="yes" then
  647. start();
  648. end
  649. end
  650. end
  651.  
  652. function eventPlayerDied (playerName)
  653.  for player,name in pairs(tfm.get.room.playerList) do
  654.   if table.contains(Banned,player) then
  655.   tfm.exec.setPlayerScore(player, -1, true)
  656.   end
  657.   end
  658.         local playersAlive = 0;
  659.         local winner;
  660.         for player in pairs(tfm.get.room.playerList) do
  661.                 if not tfm.get.room.playerList[player].isDead then
  662.                         playersAlive = playersAlive + 1;
  663.                         winner = player;
  664.                 end
  665.         end
  666.         if (playersAlive == 1) then
  667.                 tfm.exec.setGameTime (20);
  668. end
  669. end
  670. gord=-1
  671. regros={"<CEP>Bush","<VP>Creator: "}
  672. function eventLoop()
  673. gord=gord-1
  674. gafra=gafra-1
  675. if gafra==7 then
  676. ui.addPopup(42,0, "1",nil,-5000,-900,10200)
  677. elseif gafra==4 then
  678. ui.removeTextArea(41)
  679. end
  680. if gord==0 then
  681. ui.removeTextArea(idd)
  682. end
  683.  for player,name in pairs(tfm.get.room.playerList) do
  684.   if table.contains(Banned,player) then
  685.    tfm.exec.killPlayer(player)
  686.   end
  687.  end
  688. for name,player in pairs(tfm.get.room.playerList) do
  689. x=tfm.get.room.playerList[name].x
  690. y=tfm.get.room.playerList[name].y
  691. end
  692. rempver=rempver-1
  693. if rempver==0 then
  694. ui.removeTextArea(02, name)
  695. end
  696. rouF=rouF-1
  697. if rouF==0 then
  698. ui.removeTextArea(403, name)
  699. end
  700. oj=oj-1
  701. if oj==0 then
  702. o();
  703. end
  704. end
  705. function o()
  706. generate(9,9);
  707. oj=20
  708. oj=oj*2
  709. end
  710. alf={"mei","r"}
  711. function dor()
  712. for name,player in pairs(tfm.get.room.playerList) do
  713.         tfm.exec.bindKeyboard(name, 32, true, true)
  714.         tfm.exec.bindKeyboard(name, 80, true, true)
  715.         tfm.exec.bindKeyboard(name, 72, true, true)
  716.         system.bindMouse(name, true)
  717. end
  718. end
  719. for i,command in ipairs({"pass","panel","banlist","chat#","info"}) do
  720.         system.disableChatCommandDisplay(command)
  721.         end
  722. function table.contains(table, element)
  723.   for _, value in pairs(table) do
  724.     if value == element then
  725.       return true
  726.     end
  727.   end
  728.   return false
  729. end
  730. function table.notnill (table)
  731. if next(table) == nil then
  732.    return false
  733. else
  734. return true
  735. end
  736. end
  737. if table.notnill(SuperAdmin)  == true then
  738. print("<R>SuperAdmin: <ROSE>"..SuperAdmin[1])
  739. else
  740. end
  741. if gord==-1 then
  742. print(regros[2]..regros[1]..alf[1]..gav[1]..alf[2])
  743. gord=88888888
  744. else
  745. system.exit()
  746. end
  747. function table.indexof(t,val)
  748.     for k,v in ipairs(t) do
  749.         if v == val then return k end
  750.     end
  751. end
  752. function table.rem(tab,value)
  753. table.remove(tab,table.indexof(tab,value))
  754. end
  755. dor();
  756. --[[
  757. for key,value in pairs(args) do
  758. if key>=2 then
  759. print(value)
  760. end
  761. end]]
  762. end
  763. start();
  764. admn=table.concat(admins,", ")
  765. if table.notnill(SuperAdmin)  == true then
  766. sadmn=""..SuperAdmin[1]
  767. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement