Hallo,
ich und ein Freund von mir haben ein kleines Problem.
Wir wollen ein Scoreboard machen, allerdings wird es bei jeder Auslösung woanderes angezeigt.
Ich hoffe hier kriege ich dafür etwas Hilfe.
Script
Lua
local spieler = getLocalPlayer()
local gRoot = getRootElement()
local x, y = guiGetScreenSize()
local playheight = 2
getPlayersOnline = function ()
local playersOnline = getElementsByType ( "player" )
local playersO = 0
for count, playerOn in pairs(playersOnline) do
playersO = playersO + 1
end
return playersO
end
function Scoreboard()
dxDrawImage((x- 720)/2, (y-460) /2, 720, 460, "images/back.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Name", (x - 110) / 2.3, (y - 29) / 3.7, 110,29, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false)
dxDrawText(getPlayersOnline().."/50" ,(x - 101) / 1.25, (y - 27) / 4.3, ((x - 101) / 1.25) + 101, ( (y - 27) / 4.3) + 27, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText("Germain Kaff Reillife by Blackpotato", (x - 168) / 1.7, (y - 23) / 4.2, ((x - 168) / 1.7) + 168, ( (y - 23) / 3.8) + 23, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false)
dxDrawText("Ping", (x - 110) / 1.25, (y - 29) / 3.7, ((x - 110) / 1.25) + 10, ( (y - 29) / 3.7) + 29, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false)
dxDrawText("Money", (x - 110) / 1.78, (y - 29) / 3.7, ((x - 110) / 1.78) + 110, ( (y - 29) / 3.7) + 29, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false)
local players = getElementsByType ( "player" )
local playas = 0
for amt, player in pairs(players) do
playas = playas + 1
if (playas <= 20) then
local ping = getPlayerPing(player)
if (ping >= 250) then
r,g,b = 255,0,0
elseif (ping >= 120) then
r,g,b = 255,69,0
else
r,g,b = 0,255,0
end
dxDrawText(getPlayerName ( player ), x/3.15,y/1*amt/2.5, x/1.9,y/1.9, tocolor(255,255,255), 1 , "default","center", "center",false, false,true,true)
dxDrawText(ping, x/1.05,y/1*amt/2.5, x/1.9, y/1.9, tocolor(r,g,b), 1, "default","center", "center",false,false,true,true)
dxDrawText(getPlayerMoney ( player ).." $", x/1.9,y/1*amt/2.5,x/1.9, y/1.9, tocolor(255,255,255), 1, "default","center", "center",false, false, true, true)
end
end
end
function open()
opened = not opened
if opened == true then
addEventHandler("onClientRender", gRoot, Scoreboard)
else
removeEventHandler("onClientRender", gRoot, Scoreboard)
end
end
bindKey("tab","both",open)
Alles anzeigen
MfG