Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name("Tablist")
- script_author("4el0ve4ik")
- script_version("v1.1")
- require "lib.moonloader"
- local tweaks = require "lib.mgtweaks"
- local bit = require "bit"
- local qq = {}
- function main()
- local color = 0xc8202020
- local font = renderCreateFont("Arial", 8, 1)
- local font1 = renderCreateFont("Arial", 11, 1)
- local wei = 580
- if not isSampLoaded() then return end
- local resX, resY = getScreenResolution()
- local resX, resY = resX / 2, resY / 2
- local gposX, gposY = convertWindowScreenCoordsToGameScreenCoords(resX+0.0, resY+0.0)
- local h = resY - 270
- local mh = tweaks.mouseHandler:new()
- local pposX, pposY = convertGameScreenCoordsToWindowScreenCoords(320.0, 224.0)
- local scrollBar = tweaks.scrollBar:new(resX+280, resY-340, 12, wei + 110, 1000, 25)
- while true do
- wait(0)
- sampToggleScoreboard(false)
- if isKeyJustPressed(9) and not isPauseMenuActive() then
- while true do
- wait(0)
- local flags1 = mh:isKeyPressed(VK_LBUTTON, resX-320, resY-360, wei + 15, 20)
- if flags1.isWnd == true then
- if flags1.isDownWnd == true then
- resX, resY = getCursorPos()
- scrollBar.x = resX + 480
- scrollBar.y = resY + 10
- resX = resX + 200
- resY = resY + 350
- end
- end
- delta = getMousewheelDelta()
- if delta < 0 then
- scrollBar.currLine = scrollBar.currLine - delta
- end
- if 0 < delta then
- scrollBar.currLine = scrollBar.currLine - delta
- end
- if isKeyJustPressed(38) then
- scrollBar.currLine= scrollBar.currLine - 15
- end
- if isKeyJustPressed(40) then
- scrollBar.currLine = scrollBar.currLine + 15
- end
- sampToggleScoreboard(false)
- local _, id = sampGetPlayerIdByCharHandle(playerPed)
- sampSetCursorMode(3)
- local colp = bit.bor(sampGetPlayerColor(id), 0xFF000000)
- players = sampGetMaxPlayerId(false)
- renderDrawBox(resX-320, resY-340, wei+20, 690, color)
- renderDrawBox(resX-320, resY-360, wei+32, 20, 0xc8161616)
- renderDrawBox(resX-310, resY-335, wei, 20, 0xc8666666)
- renderDrawBoxWithBorder(resX-310, resY-305, wei, 23, 0xc8161616, 3, 0xc800ffff)
- renderFontDrawText(font1, string.format("id"), resX-305, resY-332, 0xff00ffff)
- renderFontDrawText(font1, string.format("NickName"), resX-230, resY-332, 0xff00ffff)
- renderFontDrawText(font1, string.format("score"), resX-50, resY-332, 0xff00ffff)
- renderFontDrawText(font1, string.format("ping"), resX+230, resY-332, 0xff00ffff)
- renderFontDrawText(font1, string.format("%d", id), resX-305, resY-302, colp)
- renderFontDrawText(font1, string.format("%s", sampGetPlayerNickname(id)), resX-230, resY-302, colp)
- renderFontDrawText(font1, string.format("%s %s:%s", sampGetCurrentServerName(), sampGetCurrentServerAddress()), resX-310, resY-358, 0xffff0000)
- renderFontDrawText(font1, string.format("%d", sampGetPlayerScore(id)), resX-50, resY-302, colp)
- renderFontDrawText(font1, string.format("%d", sampGetPlayerPing(id)), resX+230, resY-302, colp)
- scrollBar.color = 0xc8292929
- for a = 0, 1001 do
- local _, idme = sampGetPlayerIdByCharHandle(playerPed)
- if sampIsPlayerConnected(a) and a ~= idme then
- qq[#qq+1] = a
- end
- end
- scrollBar.maxLines = #qq
- for k, v in pairs(qq) do
- if k > (scrollBar.currLine ) and k <= (scrollBar.currLine + scrollBar.visibleLines) then
- local col = bit.bor(sampGetPlayerColor(v), 0xFF000000)
- local flags = mh:isKeyPressed(VK_LBUTTON, resX-310 + 4, h, wei, 20)
- if flags.isWnd == true then
- if flags.isPressedWnd == true then
- resbox = true
- zap = v
- end
- if isKeyJustPressed(VK_RBUTTON) and not isKeyDown(VK_LBUTTON) then
- setClipboardText(string.format("%s",sampGetPlayerNickname(v)))
- end
- if isKeyDown(VK_LBUTTON) and isKeyJustPressed(VK_RBUTTON) then
- sampSendClickPlayer(v, 0)
- resubreak = true
- end
- end
- renderDrawBox(resX - 310, h, wei, 20, 0xc8161616)
- renderFontDrawText(font1, string.format("%d", v), resX-305, h+3, col)
- renderFontDrawText(font1, string.format("%s", sampGetPlayerNickname(v)), resX-230, h+3, col)
- renderFontDrawText(font1, string.format("%d", sampGetPlayerScore(v)), resX-50, h+3, col)
- renderFontDrawText(font1, string.format("%d", sampGetPlayerPing(v)), resX+230, h+3, col)
- if resbox and v == zap then
- renderDrawBoxWithBorder(resX-310, h, wei, 23, 0x00101010, 3, 0xc800ffff)
- end
- h = h + 25
- end
- end
- h= resY - 275
- scrollBar:draw()
- renderFontDrawText(font1, string.format("Online:%s", #qq+1), resX+220, resY-358, 0xffff0000)
- for d = 0,1001 do
- qq[#qq] = nil
- end
- if isKeyJustPressed(9) or isKeyJustPressed(27) or resubreak then
- sampToggleCursor(false)
- for a = 1, 1001 do
- qq[#qq] = nil
- end
- resubreak = false
- break
- end
- end
- end
- end
- end
- function perm()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement