[YARDIM] Scoreboard önüne chat,harita vs çıkıyor

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı ardaabo

  • Acemi Üye
  • *
    • İleti: 145
Merhabalar, Scoreboard(TAB) açtığımda chat de ki yazılar scoreboard içine sızıyor bir türlü çözemedim yardımcı olabilecek birisi var mı acaba :))

SS burada;
Spoiler for Hiden:

client.lua
Kod
local sw, sh = guiGetScreenSize()

scoreboardColumns = {
{ name = "İsim", width = 200, data = function (element) return getPlayerName ( element ) end },
{ name = "Öldürülen insanlar", width = 120, data = function (element) return ( getElementData ( element, "murders" ) or 0 ).. "/"..( getElementData ( element, "maxmurders" ) or 0 ) end },
{ name = "Zombi Öldürme", width = 100, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ).. "/"..( getElementData ( element, "maxzombieskilled" ) or 0 ) end },
{ name = "Yaşam Süresi", width = 90, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end },
{ name = "Grup", width = 180, data = function (element) return getElementData ( element, "gang" ) or "none" end },
{ name = "Ping", width = 40, data = function (element) return getPlayerPing ( element, "getPlayerPing" ) end },
{ name = "Level", width = 100, data = function (element) return tostring((getElementData(element,"Level") or 1)) end }
}

local serverName = "MTA:DayZ" -- название сервера
local topsize = 80 -- величина шляпы
--local playersize = topsize-30 -- высота одной строки
local playersize = 15 -- высота одной строки
local panelsize = 480 -- величина панели
--local panelsize = 600 -- величина панели

function calculateWidth()
local width = 0
for key, value in ipairs( scoreboardColumns ) do
width = width + value.width
end
return width + 60
end

local max_players = 0
local ploff = 0
local width = calculateWidth()
local baseX = sw/2-width/2
local baseY = sh/2-(panelsize+topsize)/2
 
bindKey ( "tab", "up", function () ploff = 0 end )
 
addEventHandler( "onClientRender", root,
    function()
if not getKeyState( "tab" ) then return end
if getElementData(getLocalPlayer(),"logedin") then
dxDrawRectangle ( baseX, baseY, width, topsize, tocolor(32,32,32) )
dxDrawText ( serverName, baseX+20, baseY+10, baseX+width, baseY+topsize, tocolor(255,255,255), 0.9, "default-bold" )

dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0,0,0,150) )

dxDrawLine ( baseX, baseY+30, baseX+width, baseY+30, tocolor(145,138,138),0.8 )
dxDrawLine ( baseX, baseY+30, baseX, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )

dxDrawLine ( baseX+40, baseY+30, baseX+40, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawText ( "№", baseX, baseY+60, baseX+40, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" )
local xoff = 60
for i, v in ipairs ( scoreboardColumns ) do
dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" )
xoff = xoff+v.width
end
local playersTable = getElementsByType("player")

local playerData = {}
    for i=1, #playersTable do
local player = playersTable[i]
local playerKills = getElementData(player, "alivetime" ) or 0
table.insert(playerData, {player, playerKills})
end
table.sort(playerData, function(a, b) return (tonumber(a[2]) or 0) > (tonumber(b[2]) or 0) end)
--playersTable = {}
--for i = 1, 40 do
-- table.insert ( playersTable, localPlayer )
--end
--local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer }

dxDrawText ( "Oyuncu Sayısı: "..tostring(#playerData).."/"..tostring(max_players), baseX+20, baseY+10, baseX+width-20, baseY+topsize, tocolor(255,255,255), 0.9, "default-bold", "right" )

local maxNum = #playerData
if maxNum > 30 then
maxNum = 30
end
local tempoff = 0
for i = 1, maxNum do
if i == 4 or i == 11 then
tempoff = tempoff+playersize
end
dxDrawLine ( baseX, baseY+topsize+playersize*i+tempoff, baseX+width, baseY+topsize+playersize*i+tempoff, tocolor(172,162,162),0.8 )
dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1)+tempoff, baseX+40, baseY+topsize+playersize*i+tempoff, tocolor(255,255,255), 1, "default-bold", "center", "center" )
if playerData[i+ploff][1] == localPlayer then
--if i == 10 then
dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1)+tempoff, width, playersize, tocolor(112,112,112,100) )
end
local xoff = 60
for c, d in ipairs ( scoreboardColumns ) do
local data = d.data(playerData[i+ploff][1])
local r,g,b = 255,255,255
if d.name == "Grup" and data == "none" then
r,g,b = 255,0,0
data = "Grubu Bulunmamaktadır"
end
dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1)+tempoff, baseX+xoff+d.width, baseY+topsize+playersize*i+tempoff, tocolor(r,g,b), 1, "default-bold", "center", "center" )
xoff = xoff+d.width
end
end
end
end
)

function PlayerScrollMenu (key,keyState,arg)
if getElementData(localPlayer,"logedin") and getKeyState( "tab" ) then
if ( keyState == "down" ) then
if arg == "up" then
if ploff > 0 then
ploff=ploff-1
end
elseif arg == "down" then
local playersTable = getElementsByType ( "player" )
--local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer }
if ploff < #playersTable-30 then
ploff = ploff+1
end
end
end
end
end
bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" )
bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" )

function formatTimeFromMinutes(value)
if value then
local hours = math.floor(value/60)
local minutes = math.round(((value/60) - math.floor(value/60))*100/(100/60))
if minutes < 10 then minutes = "0"..minutes end
value = hours..":"..minutes
return value
end
return true
end

function math.round(number, decimals, method)
    decimals = decimals or 0
    local factor = 10 ^ decimals
    if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
    else return tonumber(("%."..decimals.."f"):format(number)) end
end

function sendMaxPlayersOnServer (players)
max_players = players
end

addEvent("sendMaxPlayersOnServer",true)
addEventHandler("sendMaxPlayersOnServer",getLocalPlayer(),sendMaxPlayersOnServer)
« Son Düzenleme: 16 Temmuz 2021, 14:29:12 Gönderen: ardaabo »
 


MTASATURK


Çevrimdışı Memati

  • Yeni Üye
  • *
    • İleti: 4
Yanıtla #1 : 17 Temmuz 2021, 00:04:34
Linki görebilmek için Kayıt olun yada Giriş yapın.
Merhabalar, Scoreboard(TAB) açtığımda chat de ki yazılar scoreboard içine sızıyor bir türlü çözemedim yardımcı olabilecek birisi var mı acaba :))

SS burada;
Spoiler for Hiden:

client.lua
Kod
local sw, sh = guiGetScreenSize()

scoreboardColumns = {
{ name = "İsim", width = 200, data = function (element) return getPlayerName ( element ) end },
{ name = "Öldürülen insanlar", width = 120, data = function (element) return ( getElementData ( element, "murders" ) or 0 ).. "/"..( getElementData ( element, "maxmurders" ) or 0 ) end },
{ name = "Zombi Öldürme", width = 100, data = function (element) return ( getElementData ( element, "zombieskilled" ) or 0 ).. "/"..( getElementData ( element, "maxzombieskilled" ) or 0 ) end },
{ name = "Yaşam Süresi", width = 90, data = function (element) return formatTimeFromMinutes(getElementData ( element, "alivetime" ) or 1 ) end },
{ name = "Grup", width = 180, data = function (element) return getElementData ( element, "gang" ) or "none" end },
{ name = "Ping", width = 40, data = function (element) return getPlayerPing ( element, "getPlayerPing" ) end },
{ name = "Level", width = 100, data = function (element) return tostring((getElementData(element,"Level") or 1)) end }
}

local serverName = "MTA:DayZ" -- название сервера
local topsize = 80 -- величина шляпы
--local playersize = topsize-30 -- высота одной строки
local playersize = 15 -- высота одной строки
local panelsize = 480 -- величина панели
--local panelsize = 600 -- величина панели

function calculateWidth()
local width = 0
for key, value in ipairs( scoreboardColumns ) do
width = width + value.width
end
return width + 60
end

local max_players = 0
local ploff = 0
local width = calculateWidth()
local baseX = sw/2-width/2
local baseY = sh/2-(panelsize+topsize)/2
 
bindKey ( "tab", "up", function () ploff = 0 end )
 
addEventHandler( "onClientRender", root,
    function()
if not getKeyState( "tab" ) then return end
if getElementData(getLocalPlayer(),"logedin") then
dxDrawRectangle ( baseX, baseY, width, topsize, tocolor(32,32,32) )
dxDrawText ( serverName, baseX+20, baseY+10, baseX+width, baseY+topsize, tocolor(255,255,255), 0.9, "default-bold" )

dxDrawRectangle ( baseX, baseY+topsize, width, panelsize, tocolor(0,0,0,150) )

dxDrawLine ( baseX, baseY+30, baseX+width, baseY+30, tocolor(145,138,138),0.8 )
dxDrawLine ( baseX, baseY+30, baseX, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawLine ( baseX, baseY+panelsize+topsize, baseX+width, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )

dxDrawLine ( baseX+40, baseY+30, baseX+40, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawText ( "№", baseX, baseY+60, baseX+40, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" )
local xoff = 60
for i, v in ipairs ( scoreboardColumns ) do
dxDrawLine ( baseX+xoff+v.width, baseY+30, baseX+xoff+v.width, baseY+panelsize+topsize, tocolor(172,162,162),0.8 )
dxDrawText ( v.name, baseX+xoff, baseY+60, baseX+xoff+v.width, baseY+topsize-30, tocolor(255,255,255), 1, "default-bold", "center", "center" )
xoff = xoff+v.width
end
local playersTable = getElementsByType("player")

local playerData = {}
    for i=1, #playersTable do
local player = playersTable[i]
local playerKills = getElementData(player, "alivetime" ) or 0
table.insert(playerData, {player, playerKills})
end
table.sort(playerData, function(a, b) return (tonumber(a[2]) or 0) > (tonumber(b[2]) or 0) end)
--playersTable = {}
--for i = 1, 40 do
-- table.insert ( playersTable, localPlayer )
--end
--local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer }

dxDrawText ( "Oyuncu Sayısı: "..tostring(#playerData).."/"..tostring(max_players), baseX+20, baseY+10, baseX+width-20, baseY+topsize, tocolor(255,255,255), 0.9, "default-bold", "right" )

local maxNum = #playerData
if maxNum > 30 then
maxNum = 30
end
local tempoff = 0
for i = 1, maxNum do
if i == 4 or i == 11 then
tempoff = tempoff+playersize
end
dxDrawLine ( baseX, baseY+topsize+playersize*i+tempoff, baseX+width, baseY+topsize+playersize*i+tempoff, tocolor(172,162,162),0.8 )
dxDrawText ( i+ploff, baseX, baseY+topsize+playersize*(i-1)+tempoff, baseX+40, baseY+topsize+playersize*i+tempoff, tocolor(255,255,255), 1, "default-bold", "center", "center" )
if playerData[i+ploff][1] == localPlayer then
--if i == 10 then
dxDrawRectangle ( baseX, baseY+topsize+playersize*(i-1)+tempoff, width, playersize, tocolor(112,112,112,100) )
end
local xoff = 60
for c, d in ipairs ( scoreboardColumns ) do
local data = d.data(playerData[i+ploff][1])
local r,g,b = 255,255,255
if d.name == "Grup" and data == "none" then
r,g,b = 255,0,0
data = "Grubu Bulunmamaktadır"
end
dxDrawText ( data, baseX+xoff, baseY+topsize+playersize*(i-1)+tempoff, baseX+xoff+d.width, baseY+topsize+playersize*i+tempoff, tocolor(r,g,b), 1, "default-bold", "center", "center" )
xoff = xoff+d.width
end
end
end
end
)

function PlayerScrollMenu (key,keyState,arg)
if getElementData(localPlayer,"logedin") and getKeyState( "tab" ) then
if ( keyState == "down" ) then
if arg == "up" then
if ploff > 0 then
ploff=ploff-1
end
elseif arg == "down" then
local playersTable = getElementsByType ( "player" )
--local playersTable = { localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer, localPlayer }
if ploff < #playersTable-30 then
ploff = ploff+1
end
end
end
end
end
bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" )
bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" )

function formatTimeFromMinutes(value)
if value then
local hours = math.floor(value/60)
local minutes = math.round(((value/60) - math.floor(value/60))*100/(100/60))
if minutes < 10 then minutes = "0"..minutes end
value = hours..":"..minutes
return value
end
return true
end

function math.round(number, decimals, method)
    decimals = decimals or 0
    local factor = 10 ^ decimals
    if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
    else return tonumber(("%."..decimals.."f"):format(number)) end
end

function sendMaxPlayersOnServer (players)
max_players = players
end

addEvent("sendMaxPlayersOnServer",true)
addEventHandler("sendMaxPlayersOnServer",getLocalPlayer(),sendMaxPlayersOnServer)

showChat(false)
 


Çevrimdışı ardaabo

  • Acemi Üye
  • *
    • İleti: 145
Yanıtla #2 : 17 Temmuz 2021, 01:44:42
Chatin kapanmasını istemiyorum sadece scoreboard'ın arkasında kalmasını istiyorum

Mesaj Birleştirildi: 17 Temmuz 2021, 13:18:36
Linki görebilmek için Kayıt olun yada Giriş yapın.
showChat(false)

ee şey showChat(false) ekledim de showChat(true) nereye eklemeliyim chati kapatıp geri açmıyor
« Son Düzenleme: 17 Temmuz 2021, 13:18:36 Gönderen: ardaabo »