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

Wysłany: 2018-09-04, 22:41


KayBay







Wiek: 26
Na forum: 2887 dni
Posty: 12
Nick w MP: ...

Piwa: 35

Respekt: 60

Ostrzeżeń: 100%
witam pomo?e mi kto? to naprawi? zamiast koloru przed nickiem pojawia sie litery,cyfry koloru







wie ktos ? tu macie kod


Cytat:


local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w, h=(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", 13*w)
local czcionka2 = dxCreateFont("f.ttf", 18*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 = "mta-storiesrpg.pl"
}

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


function sort(op1, op2)
if isElement(op1) and isElement(op2) then
return getElementData(op1, "id") < getElementData(op2, "id")
end
end

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


dxDrawImage(530*w, 307*h, 612*w, 490*h, ":srpg-tab/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(775*w, 145*h, 131*w, 190*h, ":srpg-tab/logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)

dxDrawText(zakladki.id, 540*w, 336*h, 589*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.name, 632*w, 336*h, 681*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.uid, 724*w, 336*h, 773*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.reputation, 790*w, 336*h, 839*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.organization, 878*w, 336*h, 927*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.faction, 982*w, 336*h, 1031*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(zakladki.ping, 1072*w, 336*h, 1121*w, 360*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)



dxDrawText(" "..tostring(#players).."/30 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 i >= k and i <= 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:faction") or "-"
local organization = getElementData(v, "player:oname") 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,b = getPlayerNametagColor(v)


if isMouseIn(540*w, 376*h+offsetY, 588*w, 26*h) then
dxDrawImage(540*w, 376*h+offsetY, 588*w, 26*h, ":srpg-tab/bghover.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(540*w, 376*h+offsetY, 588*w, 26*h, ":srpg-tab/tabel.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end



dxDrawText(id, 540*w, 376*h+offsetY2, 589*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(name, 632*w + 1, 376*h+offsetY2 + 1, 681*w + 1, 400*h + 1, tocolor(0, 0, 0, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(name, 632*w, 376*h+offsetY2, 681*w, 400*h, tocolor(r,g,b, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(uid, 724*w, 376*h+offsetY2, 773*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(reputation, 790*w, 376*h+offsetY2, 839*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(organization, 878*w, 376*h+offsetY2, 927*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(faction, 982*w, 376*h+offsetY2, 1031*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)
dxDrawText(ping[v].text, 1072*w, 376*h+offsetY2, 1121*w, 400*h, tocolor(255, 255, 255, 255), 1.00, czcionka, "center", "center", false, false, false, false, false)

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 n == m then return end
k = k-1
n = n-1
end

function scrollUp()
if n >= #getElementsByType("player") then return end
k = 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", root, gui)
else
tabulator = false
removeEventHandler("onClientRender", root, gui)
end
end)


Podpis







gg:62563729
discord:Pxd520#8266
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-04, 22:46


.RiV







Wiek: 25
Na forum: 3588 dni
Posty: 554
Nick w MP: Split

Piwa: 2596

Respekt: 597,8
Respekt: 597,8


Więcej informacji znajdziesz w Wikipedii MTA:

dxDrawText


Cytat:

colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.


Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-04, 23:03


KayBay







Wiek: 26
Na forum: 2887 dni
Posty: 12
Nick w MP: ...

Piwa: 35

Respekt: 60

Ostrzeżeń: 100%
".WhiteBlue" napisał/a:


Więcej informacji znajdziesz w Wikipedii MTA:

dxDrawText


Cytat:

colorCoded: Set to true to enable embedded #FFFFFF color codes. Note: clip and wordBreak are forced false if this is set.


troche nie ogarniam tego m?g?bys mi to zmienic w kodzie ?

Podpis







gg:62563729
discord:Pxd520#8266
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-05, 13:47


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

Argument colorCoded zmieniasz na True :)
Tutaj masz losowy DxDraw z tego kodu ze zmienionym argumentem
 dxDrawText(name632*1376*h+offsetY2 1681*1400*1tocolor(000255), 1.00czcionka"center""center"falsefalsefalsetruefalse


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-07, 15:22


nanKy







Wiek: 22
Na forum: 3865 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

dxDrawText(zakladki.name632*w336*h681*w360*htocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsetruefalse)


Podmie? to w swoim kodzie.

Postaw piwo autorowi tego posta
 

 
Tagi: numerki :: tabie :: zamiast :: kolorów
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