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

Wysłany: 2018-10-04, 17:56


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot??, zrobi mi kto? ?e jak klikn? taba to wy?wietli mi si? ilo?? online? Z g?ry dzi?kuje !

kod
--[[
AutorKubas Asper
]]

local scoreFunc = {}
local screenWscreenH guiGetScreenSize()
local gracze "?"
scoreFunc.page 1

scoreFunc.onPage 28

scoreFunc.renderData = {screenW 0.2723screenH 0.1497screenW 0.4561screenH 0.7005}

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

local czcionka dxCreateFont(":ogrpg-gui/font.ttf"10)
if not czcionka then czcionka "default-bold" end

local czcionka2 dxCreateFont(":ogrpg-gui/font.ttf"10)
if not czcionka2 then czcionka2 "default-bold" end

function scoreFunc.render()
    --dxDrawImage(screenW 0.2533screenH 0.0859screenW 0.4934screenH 0.8294":nm-scoreboard/sb.png"000tocolor(255255255255), false)
    local allPlayers = {}
    --table.insert(allPlayerslocalPlayer)
    for kv in ipairs(getElementsByType("player")) do
        if ~= localPlayer then
            table.insert(allPlayersv)
        end
    end
    table.sort(allPlayersscoreFunc.sort)
    local _allPlayers allPlayers
    allPlayers = {}
    table.insert(allPlayerslocalPlayer)
    for 1#_allPlayers do
        allPlayers[1] = _allPlayers[i]
    end
    _allPlayers nil

    local i 1
    gracze #allPlayers
    --exports["NEXTLIFE-BLUR"]:dxDrawBluredRectangle(scoreFunc.renderData[1], scoreFunc.renderData[2], scoreFunc.renderData[3], scoreFunc.renderData[4]-30tocolor(150150150255))
    --dxDrawLine(screenW 0.2892screenH 0.2279screenW 0.4180screenH 0.0430tocolor(1300255255), 1false)
    --local postepZDJ math.sin((getTickCount()/180)*3)
    --dxDrawImage(655,100,545,285,"logo.png"postepZDJ ,tocolor(255,255,255,255))
    dxDrawImage(scoreFunc.renderData[1], scoreFunc.renderData[2], scoreFunc.renderData[3], scoreFunc.renderData[4]-30"logo.png" ,tocolor(255,255,255,255))
    --dxDrawRectangle(screenW 0.2892screenH 0.2279screenW 0.4180screenH 0.0430tocolor(025598100), false)
    for kv in ipairs(allPlayers) do
        if >= (scoreFunc.page 1) * scoreFunc.onPage and scoreFunc.page scoreFunc.onPage then
            local ping getPlayerPing(v)
            local rggetPlayerNametagColor(v)
            dxDrawText((getElementData(v"id") or "--"), screenW 0.4120screenH 0.2813 + (1) * 20screenW 0.3175screenH 0.3177 + (1) * 20tocolor(255255255255), 1.15czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText((getElementData(v"player:uid") or "--"), screenW 0.2575screenH 0.2813 + (1) * 20screenW 0.3650screenH 0.3177 + (1) * 20tocolor(255255255255), 1.15czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(getPlayerName(v), screenW 0.4490screenH 0.2813 + (1) * 20screenW 0.4495screenH 0.3175 + (1) * 20tocolor(rgb255), 1.10czcionka"center""center"falsefalsefalsetruefalse)
            dxDrawText((getElementData(v"player:reputation") or "0"), screenW 0.7200screenH 0.2813 + (1) * 20screenW 0.5700screenH 0.3177 + (1) * 20tocolor(255255255255), 1.15czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText((getElementData(v"player:organization") or "--"), screenW 0.5200screenH 0.2813 + (1) * 20screenW 0.5200screenH 0.3177 + (1) * 20tocolor(255255255255), 1.15czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText((getElementData(v"player:duty") or "--"), screenW 0.5500screenH 0.2813 + (1) * 20screenW 0.6300screenH 0.3177 + (1) * 20tocolor(255255255255), 1.15czcionka"center""center"falsefalsefalsefalsefalse)
            dxDrawText(pingscreenW 0.6815screenH 0.2813 + (1) * 20screenW 0.6838screenH 0.3177 + (1) * 20tocolor(255255255255), 1.10czcionka"center""center"falsefalsefalsefalsefalse)
            1
        end
    end
    dxDrawText("", (screenW 0.2892) + 1, (screenH 0.1628) + 1, (screenW 0.4400) + 1, (screenH 0.2148) + 1tocolor(000255), 1.0czcionka2"left""center"falsefalsefalsefalsefalse)
    dxDrawText(""screenW 0.2892screenH 0.1628screenW 0.4400screenH 0.2148tocolor(255255255255), 1.0czcionka2"left""center"falsefalsefalsefalsefalse)
    --dxDrawLine(screenW 0.2899screenH 0.2721screenW 0.7064screenH 0.2721tocolor(1300255155), 1false)
    --dxDrawText("ID", (screenW 0.2899) + 1, (screenH 0.2292) + 1, (screenW 0.3411) + 1, (screenH 0.2721) + 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("ID"screenW 0.2899screenH 0.2292screenW 0.3411screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("UID", (screenW 0.3655) + 1, (screenH 0.2292) + 1, (screenW 0.3650) + 1, (screenH 0.2721) + 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("UID"screenW 0.3655screenH 0.2292screenW 0.3650screenH 0.271tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Nick", (screenW 0.4527) + 1, (screenH 0.2292) + 1, (screenW 0.4545) + 1, (screenH 0.2721) + 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Nick"screenW 0.4527screenH 0.2292screenW 0.4545screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("CP", (screenW 0.5200) + 1, (screenH 0.2292) + 1, (screenW 0.5200) + 1, (screenH 0.2721) + 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("CP"screenW 0.5200screenH 0.2292screenW 0.5200screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Organizacja", (screenW 0.5700) + 1, (screenH 0.2292) + 1, (screenW 0.5700) + 1, (screenH 0.2721) + 1tocolor(000255), 1.10czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Organizacja"screenW 0.5700screenH 0.2292screenW 0.5700screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("S?u?ba", (screenW 0.6300) + 1, (screenH 0.2292) + 1, (screenW 0.6300) + 1, (screenH 0.2721) + 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("S?u?ba"screenW 0.6300screenH 0.2292screenW 0.6300screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Ping"screenW 0.6654 1screenH 0.2292 1screenW 0.7064 1screenH 0.2721 1tocolor(000255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
    --dxDrawText("Ping"screenW 0.6654screenH 0.2292screenW 0.7064screenH 0.2721tocolor(255255255255), 1.0czcionka"center""center"falsefalsefalsefalsefalse)
end

function scoreFunc.bindKey(keystate)
    if state == "down" then
        addEventHandler("onClientRender"rootscoreFunc.render)
    else
        removeEventHandler("onClientRender"rootscoreFunc.render)
    end    
end
bindKey("TAB""both"scoreFunc.bindKey)

bindKey("mouse_wheel_down""down", function()
    local max math.floor(gracze scoreFunc.onPage)+1
    if max == scoreFunc.page then return end
    scoreFunc.page scoreFunc.page 1
end)

bindKey("mouse_wheel_up""down", function()
    if scoreFunc.page == 1 then return end
    scoreFunc.page scoreFunc.page 1
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-04, 18:29


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

We? w zmienn? ilo?? graczy za pomoc?


Więcej informacji znajdziesz w Wikipedii MTA:

getElementsByType


i p??niej za pomoc? dxdrawtext pobieraj dane ze zmiennej :D . Nic trudnego i ten dzia? s?u?y do pomocy, a nie ?e b?dziemy robi? co? za Ciebie..

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-04, 18:32


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Wklei? by? mi to? Bo ja zielony w lua

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-04, 18:35


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Cytat:

nie ?e b?dziemy robi? co? za Ciebie..


Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-04, 22:53


Scyrix







Wiek: 24
Na forum: 3778 dni
Posty: 30
Nick w MP: Scyrix

Piwa: 2

Respekt: 50

function graczeonline()
    local allPlayers = {}
    for kv in ipairs(getElementsByType("player")) do
        if ~= localPlayer then
            table.insert(allPlayersv)
        end
    end
    local _allPlayers allPlayers
    allPlayers = {}
    table.insert(allPlayerslocalPlayer)
    for 1#_allPlayers do
        allPlayers[1] = _allPlayers[i]
    end
    _allPlayers nil
        local i 1
    allplayers #allPlayers


Cos takiego A potem z gorki

dxDrawText("Graczy online: "..#allgracze -- BLA BLA BLA

Kombinuj nie jestem w 100 % pewnien czy dobrze to zrobilem lecz napewno jest to cos w tym stylu.
Jest to urywek kodu z jakiegos skryptu na moim dysku :P

Ostatnio zmieniony przez Shimeon 2018-10-05, 07:41, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-05, 22:11


TeeNekk

Cienzaruwka :v






Wiek: 23
Na forum: 3210 dni
Posty: 264
Nick w MP: TeeNekk.

Piwa: 919

Respekt: 110,5
Respekt: 110,5

"Scyrix" napisał/a:

function graczeonline()
    local allPlayers = {}
    for kv in ipairs(getElementsByType("player")) do
        if ~= localPlayer then
            table.insert(allPlayersv)
        end
    end
    local _allPlayers allPlayers
    allPlayers = {}
    table.insert(allPlayerslocalPlayer)
    for 1#_allPlayers do
        allPlayers[1] = _allPlayers[i]
    end
    _allPlayers nil
        local i 1
    allplayers #allPlayers


Cos takiego A potem z gorki

dxDrawText("Graczy online: "..#allgracze -- BLA BLA BLA

Kombinuj nie jestem w 100 % pewnien czy dobrze to zrobilem lecz napewno jest to cos w tym stylu.
Jest to urywek kodu z jakiegos skryptu na moim dysku :P

Co ty tworzysz XD
?atwo, i prosto

local players getElementsByType("player")

i potem aby wy?wietli? to dxDrawText(#players,...)

Podpis
Pomogłem Ci
? Może zostawiłbyś za to piwko, lub respekt? Dzięki!
Mój projekt:
?
Postaw piwo autorowi tego posta
 

 
Tagi: ilość :: osób :: online :: tabie :: (scorboardzie)
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