Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-08-13, 18:45


BoomEq







Wiek: 35
Na forum: 3522 dni
Posty: 101
Nick w MP: BoomEqqq

Piwa: 20

Respekt: 70

Witam, jeden nick nachodzi na drugi w scoreboardzie :
https://imgur.com/a/rU9tgoK


local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()
local wh=(sx/1680), (sy/1050)

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local tabulator false
local czcionka dxCreateFont("f.ttf"11*w)
local czcionka2 dxCreateFont("f.ttf"9*w)

local k 1
local n 13
local m 13

if not czcionka then
    czcionka "default"
end

local zakladki = {
    id "ID",
    name "Nazwa",
    reputation "RP",
    organization "Organizacja",
    uid "UID",
    ping "Ping",
    faction "Frakcja",
    forum "xx"
}

local ss 1
local tabulator=false
local ping = {}


function sort(op1op2)
    if isElement(op1) and isElement(op2then
        return getElementData(op1"id") < getElementData(op2"id")
    end
end

function gui()
local players = {}
for i,v in ipairs(getElementsByType("player")) do
table.insert(playersv)
end
table.sort(playerssort)


        dxDrawImage(530*w307*h612*w490*h":srpg-tab/bg.png"000tocolor(255255255255), false)
        dxDrawImage(775*w145*h131*w190*h":srpg-tab/logo.png"000tocolor(255255255255), false)
        
        dxDrawText(zakladki.id540*w336*h589*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.name632*w336*h681*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsetruefalse)
        dxDrawText(zakladki.uid724*w336*h773*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.reputation790*w336*h839*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.organization878*w336*h927*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.faction982*w336*h1031*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.ping1072*w336*h1121*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)


                
        dxDrawText("PPM - Kursor "..tostring(#players).."/35 ONLINE", 535*w, 767*h, 1138*w, 787*h, tocolor(255, 255, 255, 255), 1.00*w, czcionka2, "center", "center", false, false, false, false, false)    
local x=0        
    for i,v in pairs(players) do
        if >= and <= n then 
            x=x+1
            offsetY = (screenW/73)*(i)
            local offsetY = (30*h)*(x-1)
            local offsetY2 = (60*h)*(x-1)
            local id getElementData(v"id") or "---"
            local name getPlayerName(v) or "error"
            local reputation getElementData(v"player:reputation") or 0
            local uid getElementData(v"player:uid") or "---"
            local faction=getElementData(v,"player:duty") or "---"
            local organization getElementData(v"player:organization") or "---"

            
            if not(ping[v]) then
                ping[v] = {}
                ping[v].text getPlayerPing(v)
                ping[v].time getTickCount()
            elseif getTickCount(  )-ping[v].time 1500 then
                ping[v].text getPlayerPing(v)
                ping[v].time getTickCount()
            end

            local r,g,getPlayerNametagColor(v)
            
            
            if isMouseIn(540*w376*h+offsetY588*w26*hthen
                dxDrawImage(540*w376*h+offsetY588*w26*h":srpg-tab/bghover.png"000tocolor(255255255255), false)
            else
                dxDrawImage(540*w376*h+offsetY588*w26*h":srpg-tab/tabel.png"000tocolor(255255255255), false)
            end
            
            
            
            dxDrawText(id540*w376*h+offsetY2589*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
--            dxDrawText(name632*1376*h+offsetY2 1681*1400*1tocolor(000255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(name632*w415*h681*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsetruefalse)
--            dxDrawText(name632*w376*h+offsetY2681*w400*htocolor(r,g,b255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(uid724*w376*h+offsetY2773*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(reputation790*w376*h+offsetY2839*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(organization878*w376*h+offsetY2927*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(faction982*w376*h+offsetY21031*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(ping[v].text1072*w376*h+offsetY21121*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            
        end
    end
end

bindKey("mouse_wheel_down""both", function()
    if tabulator ~= true then return end
    scrollUp()
end)

bindKey("mouse_wheel_up""both", function()
    if tabulator ~= true then return end
    scrollDown()
end)


function scrollDown()
    if == m then return end
    k k-1
    n n-1
end

function scrollUp()
    if >= #getElementsByType("player") then return end
    k+1
    n n+1
end

bindKey("mouse2""down", function()
    if tabulator == false then return end
    if isCursorShowing() == false then
        showCursor(true)
    else    
        showCursor(false)
    end
end)

bindKey("TAB""both", function()
    if not getElementData(localPlayer,"player:logged"then return end
    if tabulator == false then
        tabulator true
        addEventHandler("onClientRender"rootgui)
    else
        tabulator false
        removeEventHandler("onClientRender"rootgui)
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-13, 20:05


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Powinno dzia?a? :)

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()
local wh=(sx/1680), (sy/1050)

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local tabulator false
local czcionka dxCreateFont("f.ttf"11*w)
local czcionka2 dxCreateFont("f.ttf"9*w)

local k 1
local n 13
local m 13

if not czcionka then
    czcionka "default"
end

local zakladki = {
    id "ID",
    name "Nazwa",
    reputation "RP",
    organization "Organizacja",
    uid "UID",
    ping "Ping",
    faction "Frakcja",
    forum "xx"
}

local ss 1
local tabulator=false
local ping = {}


function sort(op1op2)
    if isElement(op1) and isElement(op2then
        return getElementData(op1"id") < getElementData(op2"id")
    end
end

function gui()
local players = {}
for i,v in ipairs(getElementsByType("player")) do
table.insert(playersv)
end
table.sort(playerssort)


        dxDrawImage(530*w307*h612*w490*h":srpg-tab/bg.png"000tocolor(255255255255), false)
        dxDrawImage(775*w145*h131*w190*h":srpg-tab/logo.png"000tocolor(255255255255), false)
        
        dxDrawText(zakladki.id540*w336*h589*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.name632*w336*h681*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsetruefalse)
        dxDrawText(zakladki.uid724*w336*h773*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.reputation790*w336*h839*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.organization878*w336*h927*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.faction982*w336*h1031*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawText(zakladki.ping1072*w336*h1121*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)


                
        dxDrawText("PPM - Kursor "..tostring(#players).."/35 ONLINE", 535*w, 767*h, 1138*w, 787*h, tocolor(255, 255, 255, 255), 1.00*w, czcionka2, "center", "center", false, false, false, false, false)    
local x=0        
    for i,v in pairs(players) do
        if >= and <= n then 
            x=x+1
            offsetY = (screenW/73)*(i)
            local offsetY = (30*h)*(x-1)
            local offsetY2 = (60*h)*(x-1)
            local id getElementData(v"id") or "---"
            local name getPlayerName(v) or "error"
            local reputation getElementData(v"player:reputation") or 0
            local uid getElementData(v"player:uid") or "---"
            local faction=getElementData(v,"player:duty") or "---"
            local organization getElementData(v"player:organization") or "---"

            
            if not(ping[v]) then
                ping[v] = {}
                ping[v].text getPlayerPing(v)
                ping[v].time getTickCount()
            elseif getTickCount(  )-ping[v].time 1500 then
                ping[v].text getPlayerPing(v)
                ping[v].time getTickCount()
            end

            local r,g,getPlayerNametagColor(v)
            
            
            if isMouseIn(540*w376*h+offsetY588*w26*hthen
                dxDrawImage(540*w376*h+offsetY588*w26*h":srpg-tab/bghover.png"000tocolor(255255255255), false)
            else
                dxDrawImage(540*w376*h+offsetY588*w26*h":srpg-tab/tabel.png"000tocolor(255255255255), false)
            end
            
            
            
            dxDrawText(id540*w376*h+offsetY2589*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
--            dxDrawText(name632*1376*h+offsetY2 1681*1400*1tocolor(000255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(name632*w415*h+offsetY2681*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsetruefalse)
--            dxDrawText(name632*w376*h+offsetY2681*w400*htocolor(r,g,b255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(uid724*w376*h+offsetY2773*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(reputation790*w376*h+offsetY2839*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(organization878*w376*h+offsetY2927*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(faction982*w376*h+offsetY21031*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(ping[v].text1072*w376*h+offsetY21121*w400*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
            
        end
    end
end

bindKey("mouse_wheel_down""both", function()
    if tabulator ~= true then return end
    scrollUp()
end)

bindKey("mouse_wheel_up""both", function()
    if tabulator ~= true then return end
    scrollDown()
end)


function scrollDown()
    if == m then return end
    k k-1
    n n-1
end

function scrollUp()
    if >= #getElementsByType("player") then return end
    k+1
    n n+1
end

bindKey("mouse2""down", function()
    if tabulator == false then return end
    if isCursorShowing() == false then
        showCursor(true)
    else    
        showCursor(false)
    end
end)

bindKey("TAB""both", function()
    if not getElementData(localPlayer,"player:logged"then return end
    if tabulator == false then
        tabulator true
        addEventHandler("onClientRender"rootgui)
    else
        tabulator false
        removeEventHandler("onClientRender"rootgui)
    end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
BoomEq
Tagi: scoreboard
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku