Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. require "lib.moonloader"
  2. require "lib.sampfuncs"
  3.  
  4. function main()
  5. repeat wait(0) until isSampAvailable()
  6. wait(2000)
  7. sampAddChatMessage('Komuna checker zostal uruchomiony.', -1)
  8.  
  9. local font_flag = require('moonloader').font_flag
  10. local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)
  11. local count = 0
  12. local count2 = 0
  13. local toggle = true
  14. local toggleChars = true
  15. local admins = {"GM_","Amy_Reif","John_Diaz","Patrick_Squillante","Beyonce_Bennett","Andre_Schavione","Danny_Bartolocci","David_Riddle","Jacob_Williams","James_Duble","John_Mrucznik","Kimble_Hookstraten","Justin_Devilson","Kenyon_Carrington","Kevin_Russell","Luis_Ravens","Felipe_Navarez","Michael_West","Quinton_Brown","Garrett_Carrington","Sean_Lee","Shawn_Smith","Simon_Heratti","Stewart_West","Sven_Helvetica","Tom_Bananov","Tom_Thompson","Dawid_Ciarkowskhi","Simon_Cotta"}
  16. local adminsChars = {
  17. -- Komuniści, spierdoliny maślakowe
  18.  
  19. {char = 'Malcolm Lawyers', gm = 'Ferrum'},
  20. {char = 'Samson Richards', gm = 'ShowTime'},
  21. {char = 'Noah Bono', gm = 'Herix'},
  22. {char = 'Lena McFly', gm = 'Lenka'},
  23. {char = 'Michael Whiteford', gm = 'Roflmao'},
  24. {char = 'Brayan Stewart', gm = 'Seba'},
  25. {char = 'Claire MacMillan', gm = 'Mikeros'},
  26. {char = 'Maximillian Barker', gm = 'Peres'},
  27. {char = 'Vivianne Hendricks', gm = 'Pilecka'},
  28. {char = 'Nikolas Danna', gm = 'Godzio'},
  29. {char = 'Tony Weaver', gm = 'Bialas'},
  30. {char = 'Grant Tyler', gm = 'Whizz'},
  31. {char = 'Dave Rayford', gm = 'Skino'},
  32. {char = 'Garret Henriquez', gm = 'Kadi'},
  33. {char = 'Nancy Mills', gm = 'Kadi'},
  34. {char = 'David Webber', gm = 'Mazurek'},
  35. }
  36.  
  37. while true do wait(1)
  38.  
  39. count = 0
  40. count2 = 0
  41.  
  42. if wasKeyReleased(0x24) then
  43. toggle = not toggle
  44. if toggle then printStringNow('~g~ Komuna Checker', 1000) else printStringNow('~r~ Komuna Checker', 1000) end
  45. end
  46.  
  47. if isKeyJustPressed(0x23) then
  48. toggleChars = not toggleChars
  49. if toggleChars then printStringNow('~g~ Komuna Checker - admins chars', 1000) else printStringNow('~r~ Komuna Checker - admins chars', 1000) end
  50. end
  51.  
  52. if isKeyJustPressed(0x77) then
  53. wait(1000)
  54. end
  55.  
  56. if toggle and not isGamePaused() and isPlayerPlaying(PLAYER_HANDLE) then
  57. for i = 0, sampGetMaxPlayerId(false) do
  58. if sampIsPlayerConnected(i) then
  59.  
  60. local nick = sampGetPlayerNickname(i)
  61. local hp = sampGetPlayerHealth(i)
  62. local chuj, ped = sampGetCharHandleBySampPlayerId(i)
  63.  
  64. for _, a in ipairs(admins) do
  65. if string.find(string.lower(nick), string.lower(a)) then
  66. nick = string.gsub(nick, '_', ' ')
  67. renderFontDrawText(my_font, 'Komunisci online:', 10, 400, 0xff00FFFF)
  68. if hp == 0 then
  69.  
  70. health = " "
  71. color = 0xffA52A2A
  72. dystans = "za daleko"
  73. else
  74. renderFontDrawText(my_font, 'ADMIN W POLU WIDZENIA', 10, 375 , 0xff7FFF00)
  75. health = "DANGER"
  76. color = 0xff7FFF00
  77. local oX, oY, oZ = getCharCoordinates(ped)
  78. local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
  79. --renderFontDrawText(my_font, oX..":"..oY..":"..oZ, 10, 345 , 0xff7FFF00)
  80. end
  81. dystans = getDistanceBetweenCoords2d(oX, oY, pX, pY)
  82. dystans = round(dystans, 2)
  83. renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ('..health..' - '..dystans..')', 10, 425 + (count * 25) , color)
  84. count = count + 1
  85. end
  86. end
  87.  
  88. nick = string.gsub(nick, '_', ' ')
  89.  
  90. if toggleChars then
  91. for _, b in ipairs(adminsChars) do
  92. if string.find(string.lower(nick), string.lower(b['char'])) then
  93. renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ('..b['gm']..') ', 10, 425 + (count * 25) , 0xffA52A2A)
  94. count = count + 1
  95. end
  96. end
  97. end
  98.  
  99. if sampGetPlayerColor(i) == 2852126720 then
  100. renderFontDrawText(my_font, 'Niezalogowani:', 1700, 400, 0xffFFFFFF)
  101. renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ', 1700, 425 + (count2 * 25) , 0xffFFFFFF)
  102. count2 = count2 + 1
  103. end
  104. end
  105. end
  106. end
  107. end
  108. end
  109.  
  110. function round(num, numDecimalPlaces)
  111. if numDecimalPlaces and numDecimalPlaces>0 then
  112. local mult = 10^numDecimalPlaces
  113. return math.floor(num * mult + 0.5) / mult
  114. end
  115. return math.floor(num + 0.5)
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement