Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 KB | None | 0 0
  1. admin = "Isco#5327" -- اسم الادمن
  2. password = "8910" -- كلمة السرّ
  3. players={} -- لا تكتب أي شئ هنا
  4. system.disableChatCommandDisplay("password")
  5.  
  6. function pw(name)
  7. print("<font color='#ffffff'> ! تم تفعيل كلمة السر فى بيت القبيلة")
  8. for name,player in pairs(tfm.get.room.playerList) do
  9. if name == admin then
  10. for poups, k in pairs({"1","2","3","4","5","6"}) do
  11. ui.removeTextArea(k, admin)
  12. end
  13. else
  14. ui.addTextArea(1, "", name, -1499, -1500, 3000, 3000, 0x000001, 0x000001, 1, true)
  15. ui.addTextArea(2, "", name, 5, 28, 789, 367, 0x544731, 0xffffff, 1, true)
  16. ui.addTextArea(3, "", name, 8, 31, 783, 361, 0x324650, 0x000000, 1, true)
  17. ui.addTextArea(4, "\n<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'><b>بيت القبيلة مُغلقٌ بكلمةِ سرّ</b>\n\n<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'>ادخِل كلمة السرّ هنا", name, 11, 34, 777, 355, 0x523d25, 0xc4621c, 1, true)
  18. ui.addTextArea(5, "<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'><b>"..players[name].txt.."", name, 231, 202, 344, 71, 0x324650, 0x000000, 0, true)
  19. ui.addTextArea(6, "<font color='#ffffff'>", name, 679, 359, 106, 27, 0x523d25, 0x000000, 1, true)
  20. ui.updateTextArea(6,"<font color='#009D9D'> "..players[name].try.." <font color='#ffffff'> : المحاولات المتبقية",name)
  21. ui.addPopup(0, 2, "<p align='center'> ↓ ادخِل كلمة السرّ هنا", name, 296, 205, 217, true)
  22. end
  23. end
  24. end
  25.  
  26. function eventNewPlayer(name)
  27. players[name]={
  28. try = 3, -- عدد مرات المحاولات
  29. txt = ""
  30. }
  31. if name == admin then
  32. for poups, k in pairs({"1","2","3","4","5","6"}) do
  33. ui.removeTextArea(k, admin)
  34. end
  35. else
  36. ui.addTextArea(1, "", name, -1499, -1500, 3000, 3000, 0x000001, 0x000001, 1, true)
  37. ui.addTextArea(2, "", name, 5, 28, 789, 367, 0x544731, 0xffffff, 1, true)
  38. ui.addTextArea(3, "", name, 8, 31, 783, 361, 0x324650, 0x000000, 1, true)
  39. ui.addTextArea(4, "\n<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'><b>بيت القبيلة مُغلقٌ بكلمةِ سرّ</b>\n\n<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'>ادخِل كلمة السرّ هنا", name, 11, 34, 777, 355, 0x523d25, 0xc4621c, 1, true)
  40. ui.addTextArea(5, "<p align='center'><font color='#babd2f' size='25' face='Comic Sans MS'><b>"..players[name].txt.."", name, 231, 202, 344, 71, 0x324650, 0x000000, 0, true)
  41. ui.addTextArea(6, "<font color='#ffffff'>", name, 679, 359, 106, 27, 0x523d25, 0x000000, 1, true)
  42. ui.updateTextArea(6,"<font color='#009D9D'> "..players[name].try.." <font color='#ffffff'> : المحاولات المتبقية",name)
  43. ui.addPopup(0, 2, "<p align='center'> ↓ ادخِل كلمة السرّ هنا", name, 296, 205, 217, true)
  44. end
  45. end
  46.  
  47. for name,player in pairs(tfm.get.room.playerList) do
  48. eventNewPlayer(name)
  49. end
  50.  
  51. function removepw(name)
  52. for poups, k in pairs({"1","2","3","4","5","6"}) do
  53. ui.removeTextArea(k, name)
  54. end
  55. end
  56.  
  57. function popup(name)
  58. ui.addPopup(0, 2, "<p align='center'> ↓ ادخِل كلمة السرّ هنا", name, 296, 205, 217, true)
  59. end
  60.  
  61. function split(t,s)local a={}for i,v in string.gmatch(t,string.format("[^%s]+",s or"%s"))do table.insert(a,i)end;return a end
  62.  
  63. function eventChatCommand ( playerName, command )
  64. local arg = split(command, " ")
  65. if playerName == admin then
  66. if arg[1]=="password" then
  67. password = arg[2] or ""
  68. print("<font color='#009D9D'> "..password.." <font color='#ffffff'>تمّ تغيير كلمة السر واصبحت")
  69. end
  70. end
  71. end
  72.  
  73. function eventPopupAnswer(id,name,ans)
  74. if id == 0 then
  75. if ans== password then
  76. removepw(name)
  77. print (" <font color='#ffffff'> كلمة السرّ الصحيحة <font color='#009D9D'> "..name.." <font color='#ffffff'> ادخل")
  78. else
  79. players[name].try = players[name].try - 1
  80. ui.updateTextArea(6,"<font color='#009D9D'> "..players[name].try.." <font color='#ffffff'> : المحاولات المتبقية",name)
  81. popup(name)
  82. print (" <font color='#EB1D51'> "..ans.." <font color='#ffffff'> كلمة سرٍ خاطئة وكانت <font color='#009D9D'> "..name.." <font color='#ffffff'> ادخل ")
  83. if players[name].try > 0 then
  84. popup(name)
  85. end
  86. if players[name].try == 0 then
  87. ui.addPopup(0, 2, "<p align='center'> ↓ ادخِل كلمة السرّ هنا", name, 296, -2205, 217, true)
  88. players[name].txt = "!! انتهت جميع المحاولات"
  89. ui.updateTextArea(5,"<font color='#ffffff'>"..players[name].txt.."",name)
  90. end
  91. end
  92. end
  93. end
  94.  
  95. table.foreach(tfm.get.room.playerList, eventNewPlayer)
  96. pw(name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement