Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "lib.moonloader"
- require "lib.sampfuncs"
- function main()
- repeat wait(0) until isSampAvailable()
- wait(2000)
- sampAddChatMessage('Komuna checker zostal uruchomiony.', -1)
- local font_flag = require('moonloader').font_flag
- local my_font = renderCreateFont('Verdana', 12, font_flag.BOLD + font_flag.SHADOW)
- local count = 0
- local count2 = 0
- local toggle = true
- local toggleChars = true
- 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"}
- local adminsChars = {
- -- Komuniści, spierdoliny maślakowe
- {char = 'Malcolm Lawyers', gm = 'Ferrum'},
- {char = 'Samson Richards', gm = 'ShowTime'},
- {char = 'Noah Bono', gm = 'Herix'},
- {char = 'Lena McFly', gm = 'Lenka'},
- {char = 'Michael Whiteford', gm = 'Roflmao'},
- {char = 'Brayan Stewart', gm = 'Seba'},
- {char = 'Claire MacMillan', gm = 'Mikeros'},
- {char = 'Maximillian Barker', gm = 'Peres'},
- {char = 'Vivianne Hendricks', gm = 'Pilecka'},
- {char = 'Nikolas Danna', gm = 'Godzio'},
- {char = 'Tony Weaver', gm = 'Bialas'},
- {char = 'Grant Tyler', gm = 'Whizz'},
- {char = 'Dave Rayford', gm = 'Skino'},
- {char = 'Garret Henriquez', gm = 'Kadi'},
- {char = 'Nancy Mills', gm = 'Kadi'},
- {char = 'David Webber', gm = 'Mazurek'},
- }
- while true do wait(1)
- count = 0
- count2 = 0
- if wasKeyReleased(0x24) then
- toggle = not toggle
- if toggle then printStringNow('~g~ Komuna Checker', 1000) else printStringNow('~r~ Komuna Checker', 1000) end
- end
- if isKeyJustPressed(0x23) then
- toggleChars = not toggleChars
- if toggleChars then printStringNow('~g~ Komuna Checker - admins chars', 1000) else printStringNow('~r~ Komuna Checker - admins chars', 1000) end
- end
- if isKeyJustPressed(0x77) then
- wait(1000)
- end
- if toggle and not isGamePaused() and isPlayerPlaying(PLAYER_HANDLE) then
- for i = 0, sampGetMaxPlayerId(false) do
- if sampIsPlayerConnected(i) then
- local nick = sampGetPlayerNickname(i)
- local hp = sampGetPlayerHealth(i)
- local chuj, ped = sampGetCharHandleBySampPlayerId(i)
- for _, a in ipairs(admins) do
- if string.find(string.lower(nick), string.lower(a)) then
- nick = string.gsub(nick, '_', ' ')
- renderFontDrawText(my_font, 'Komunisci online:', 10, 400, 0xff00FFFF)
- if hp == 0 then
- health = " "
- color = 0xffA52A2A
- dystans = "za daleko"
- else
- renderFontDrawText(my_font, 'ADMIN W POLU WIDZENIA', 10, 375 , 0xff7FFF00)
- health = "DANGER"
- color = 0xff7FFF00
- local oX, oY, oZ = getCharCoordinates(ped)
- local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
- --renderFontDrawText(my_font, oX..":"..oY..":"..oZ, 10, 345 , 0xff7FFF00)
- end
- dystans = getDistanceBetweenCoords2d(oX, oY, pX, pY)
- dystans = round(dystans, 2)
- renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ('..health..' - '..dystans..')', 10, 425 + (count * 25) , color)
- count = count + 1
- end
- end
- nick = string.gsub(nick, '_', ' ')
- if toggleChars then
- for _, b in ipairs(adminsChars) do
- if string.find(string.lower(nick), string.lower(b['char'])) then
- renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ('..b['gm']..') ', 10, 425 + (count * 25) , 0xffA52A2A)
- count = count + 1
- end
- end
- end
- if sampGetPlayerColor(i) == 2852126720 then
- renderFontDrawText(my_font, 'Niezalogowani:', 1700, 400, 0xffFFFFFF)
- renderFontDrawText(my_font, '' ..i.. ' - ' ..nick.. ' ', 1700, 425 + (count2 * 25) , 0xffFFFFFF)
- count2 = count2 + 1
- end
- end
- end
- end
- end
- end
- function round(num, numDecimalPlaces)
- if numDecimalPlaces and numDecimalPlaces>0 then
- local mult = 10^numDecimalPlaces
- return math.floor(num * mult + 0.5) / mult
- end
- return math.floor(num + 0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement