Danke Das weiß ich sehr zu schätzen. Ich danke auch alle anderen für die gute Kritik.
#nohomo
Danke Das weiß ich sehr zu schätzen. Ich danke auch alle anderen für die gute Kritik.
#nohomo
Ich denke schon. Warum?
Stimmt. Ich glaube ich ändere es doch xD
Registrierung ist Arial Black und das mit den Lichterketten ist extra falsch herum.
Habe nun auch ein Fenster für das registrieren gemacht.
So habe es nochmal überarbeitet und weihnachtlicher gemacht.
Das mit den Linien ist auch eine gute Idee und die Überschriften werden per Script gesetzt.
Danke. Bei den fetten Linien bin ich mir auch nicht so sicher, ich schau nochmal. Ich benutze jetzt diesen Thread für die nächsten Scoreboard Designs/Verbesserungen.
EDIT: Habe das Scoreboard nun ein Muster verliehen und ein Slogan unter dem Namen gemacht. Die Linien hab ich auch dünner gemacht und es sieht viel besser aus. Danke für den Vorschlag @PewX.
Ich habe nun mein Scoreboard nochmal erneuert. Da mir das alte Design doch nicht so toll gefiel. Verbesserungsvorschläge usw. nehme ich gerne an!
local playerListLabels = {}
local playerListFactionMembersLabel = {}
local playersOnline = {}
local playersOnlineData = {}
local curPlayerListPosition = 1
local playerCount = 0
local playerListWidth = 1000
local playerListHeight = 510
local maxPlayersInCurList = 17
local maxPlayers = 250
local playersToScrollPerButton = 10
function changeAlpha ()
if (alpha == 255) then
alpha = 255
removeEventHandler("onClientRender", root, changeAlpha)
end
end
addEventHandler("onClientRender", root, changeAlpha)
function recieveServerSlotCount ( max )
maxPlayers = max
end
addEvent ( "recieveServerSlotCount", true )
addEventHandler ( "recieveServerSlotCount", getRootElement(), recieveServerSlotCount )
triggerServerEvent ( "getServerSlotCount", lp )
local radioUpState, radioDownState, weaponUpState, weaponDownState
function fillPlayerListOnStart ()
local players = getElementsByType ( "player" )
for key, index in pairs ( players ) do
playerCount = playerCount + 1
playersOnlineData[index] = playerCount
playersOnline[playerCount] = index
end
end
fillPlayerListOnStart ()
function clientPlayerListDisconnect ()
local i = playersOnlineData[source]
playersOnline[i] = nil
playerCount = playerCount - 1
end
addEventHandler ( "onClientPlayerQuit", getRootElement(), clientPlayerListDisconnect )
function clientPlayerListConnect ()
local i
for k = 1, maxPlayers do
if not playersOnline[k] then
i = k
break
end
end
playerCount = playerCount + 1
playersOnlineData[source] = i
playersOnline[i] = source
end
addEventHandler ( "onClientPlayerJoin", getRootElement(), clientPlayerListConnect )
function showPlayerList ()
if gImage["playerList"] then
guiSetVisible ( gImage["playerList"], true )
else
local label, img
--gImage["playerList"] = guiCreateStaticImage(screenwidth/2-playerListWidth/2,screenheight/2-playerListHeight/2,playerListWidth,playerListHeight,"images/colors/c_black.jpg",false)
gImage["playerList"] = guiCreateStaticImage(screenwidth/2-playerListWidth/2,screenheight/2-playerListHeight/2,playerListWidth,playerListHeight,"images/scoreboard.png",false)
guiSetAlpha(gImage["playerList"],0.9)
fadeScoreboard = function(keyState)
local fadeProgress = 0
if keyState == "down" then
fadeProgress = fadeProgress+0.01
local alphaValue = interpolateBetween(0,0,0,255,0,0,fadeProgress,"InOutQuad")
--dxDrawStuff + tocolor(r,g,b,alphaValue)
if alphaValue>=1 then
removeEventHandler("onClientRender",root,renderScoreboard)
end
elseif keyState == "up" then
fadeProgress = fadeProgress-0.01
local alphaValue = interpolateBetween(0,0,0,255,0,0,fadeProgress,"InOutQuad")
--dxDrawStuff + tocolor(r,g,b,alphaValue)
if alphaValue<=0 then
removeEventHandler("onClientRender",root,renderScoreboard)
end
end
end
addEventHandler("onPlayerJoin",root,function()
bindKey(source,"tab","both",function(_,keyState)
function renderScoreboard()
fadeScoreboard(keyState)
end
addEventHandler("onClientRender",root,renderScoreboard)
end)
end)
label = guiCreateLabel(50,80,45,23,"Name",false,gImage["playerList"])
guiSetAlpha(label,1)
myFont = guiCreateFont( "drakoheart.ttf", 15 )
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label, myFont)
--img = guiCreateStaticImage(8,23,453,5,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(180,80,140,23,"Sozialer Status",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
label = guiCreateLabel(370,80,85,20,"Spielzeit",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
--img = guiCreateStaticImage(151,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
--img = guiCreateStaticImage(265,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(510,80,85,25,"Telefonnr.",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
--img = guiCreateStaticImage(333,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
--img = guiCreateStaticImage(413,28,3,268,"images/colors/c_green.jpg",false,gImage["playerList"])
--guiSetAlpha(img,0.7)
label = guiCreateLabel(660,80,75,25,"Fraktion",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
label = guiCreateLabel(850,80,57,25,"Ping",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
label = guiCreateLabel(940,80,57,25,"VIP",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,myFont)
--gImage["playerListBarBG"] = guiCreateStaticImage(472,0,12,playerListHeight,"images/colors/c_white.jpg",false,gImage["playerList"])
--guiSetAlpha(gImage["playerListBarBG"],0.7)
--gImage["playerListBarPull"] = guiCreateStaticImage(0,17,12,33,"images/colors/c_black.jpg",false,gImage["playerListBarBG"])
--guiSetAlpha(gImage["playerListBarPull"],1)
gLabel["playerListPlayers"] = guiCreateLabel(45,530,100,25,"0/"..maxPlayers.." Spieler",false,gImage["playerList"])
guiSetAlpha(gLabel["playerListPlayers"],1)
guiLabelSetColor(gLabel["playerListPlayers"],255,255,255)
guiLabelSetVerticalAlign(gLabel["playerListPlayers"],"top")
guiLabelSetHorizontalAlign(gLabel["playerListPlayers"],"left",false)
guiSetFont(gLabel["playerListPlayers"],myFont)
--gImage["playerListBarPull"] = guiCreateStaticImage(0,17,12,33,"images/colors/c_black.jpg",false,gImage["playerListBarBG"])
--guiSetAlpha(gImage["playerListBarPull"],1)
for i, index in pairs ( factionColors ) do
if i > 0 then
local r, g, b = factionColors[i][1], factionColors[i][2], factionColors[i][3]
playerListFactionMembersLabel[i] = guiCreateLabel(175+175+(i)*28,540,20,18,"",false,gImage["playerList"])
test = guiCreateLabel(175+175+(i)*30,540,20,18,"",false,gImage["playerList"])
guiSetAlpha(playerListFactionMembersLabel[i],1)
guiSetAlpha(test,1)
guiLabelSetColor(playerListFactionMembersLabel[i],r,g,b)
guiLabelSetColor(test,r,g,b)
guiLabelSetVerticalAlign(playerListFactionMembersLabel[i],"top")
guiLabelSetVerticalAlign(test,"top")
guiLabelSetHorizontalAlign(playerListFactionMembersLabel[i],"left",false)
guiLabelSetHorizontalAlign(test,"left",false)
guiSetFont(playerListFactionMembersLabel[i],myFont)
guiSetFont(test,myFont)
end
end
for i = 1, maxPlayersInCurList do
playerListLabels[i] = {}
playerListLabels[i][1] = guiCreateLabel(50,100 - 16 + 16 * i,141,25,"",false,gImage["playerList"])
playerListLabels[i][2] = guiCreateLabel(180,100 - 16 + 16 * i,160,25,"",false,gImage["playerList"])
playerListLabels[i][3] = guiCreateLabel(370,100 - 16 + 16 * i,141,25,"",false,gImage["playerList"])
playerListLabels[i][4] = guiCreateLabel(510,100 - 16 + 16 * i,141,25,"",false,gImage["playerList"])
playerListLabels[i][5] = guiCreateLabel(660,100 - 16 + 16 * i,141,25,"",false,gImage["playerList"])
playerListLabels[i][6] = guiCreateLabel(850,100 - 16 + 16 * i,141,25,"",false,gImage["playerList"])
for k = 1, 6 do
guiSetAlpha(playerListLabels[i][k],1)
guiLabelSetColor(playerListLabels[i][k],255,255,255)
guiLabelSetVerticalAlign(playerListLabels[i][k],"top")
guiLabelSetHorizontalAlign(playerListLabels[i][k],"left",false)
guiSetFont(playerListLabels[i][k],myFont)
end
guiLabelSetColor ( playerListLabels[i][2], 200, 200, 0 )
end
end
updatePlayerList ()
end
function updateFactionPlayerCount ()
factionCounter = {}
local players = getElementsByType ( "player" )
for key, index in pairs ( players ) do
local i = getElementData ( index, "fraktion" )
if i then
if not factionCounter[i] then
factionCounter[i] = {}
end
factionCounter[i][index] = true
end
end
for i, index in pairs ( factionColors ) do
if playerListFactionMembersLabel[i] then
local length = tableLength ( factionCounter[i] )
if length > 0 then
guiSetText ( playerListFactionMembersLabel[i], length )
else
guiSetText ( playerListFactionMembersLabel[i], "" )
end
end
end
end
function tableLength ( table )
local i = 0
if table then
for _, _ in pairs ( table ) do
i = i + 1
end
end
return i
end
function updatePlayerList ()
if guiGetVisible ( gImage["playerList"] ) then
updateFactionPlayerCount ()
guiSetText ( gLabel["playerListPlayers"], playerCount.."/"..maxPlayers.." Spieler" )
reFillPlayerList ()
playerListUpdateTimer = setTimer ( updatePlayerList, 1000, 1 )
end
end
function reAdjustPlayerListScollBar ()
--[[pxPerPlayer = playerListHeight / ( playerCount )
barSize = maxPlayersInCurList / playerCount * playerListHeight
if barSize > playerListHeight then
]]
pxPerPlayer = 310 / ( playerCount )
barSize = maxPlayersInCurList / playerCount * 310
if barSize > 310 then
barSize = 1
barYPos = 0
else
barYPos = ( curPlayerListPosition - 1 ) * ( pxPerPlayer )
end
--guiSetSize ( gImage["playerListBarPull"], 17, barSize, false )
--guiSetPosition ( gImage["playerListBarPull"], 0, barYPos, false )
end
function reFillPlayerList ()
for key, index in pairs ( playerListLabels ) do
for i = 1, 6 do
guiSetText ( playerListLabels[key][i], "" )
end
end
local i = 0
local k = 0
local name, rang, playingtime, ping, r, g, b, vip
for z = -2, factioncount do
for key, index in pairs ( playersOnline ) do
if ( z == -2 and not getElementData ( index, "loggedin" ) ) or ( z == -1 and getElementData ( index, "loggedin" ) == 0 ) or getElementData ( index, "fraktion" ) == z then
i = i + 1
if k > maxPlayersInCurList then
break
end
if i >= curPlayerListPosition then
k = k + 1
name = getPlayerName ( index )
rang = getElementData ( index, "socialState" )
fraktion = getElementData ( index, "fraktion" )
vip = getElementData ( index, "premium" )
ping = tonumber ( getPlayerPing ( index ) )
if not rang then
rang = "Verbinden..."
nr = ""
playingtime = ""
r, g, b = 175, 175, 175
else
nr = getElementData ( index, "telenr" )
local faction = getElementData ( index, "fraktion" )
r, g, b = factionColors[faction][1], factionColors[faction][2], factionColors[faction][3]
playingtime = getElementData ( index, "playingtime" )
playingtime = math.floor ( playingtime / 60 )..":"..( playingtime - math.floor ( playingtime / 60 ) * 60 )
end
if not fraktion then
fraktion = "-"
else
fraktion = fraktionsNamen[fraktion]
end
if getElementData ( index, "prem" ) == 1 then
playerListLabels[k][7] = guiCreateStaticImage(10,95 - 20 + 20 * i,40,35,"images/nametag/premium.png",false,gImage["playerList"])
end
if isElement(playerListLabels[k][1]) and name then
guiSetText ( playerListLabels[k][1], name )
end
guiSetText ( playerListLabels[k][2], rang )
guiSetText ( playerListLabels[k][3], playingtime )
guiSetText ( playerListLabels[k][4], nr )
guiSetText ( playerListLabels[k][5], fraktion )
guiSetText ( playerListLabels[k][6], ping )
pr, pg, pb = getPingColor ( ping )
guiLabelSetColor ( playerListLabels[k][1], r, g, b )
guiLabelSetColor ( playerListLabels[k][5], r, g, b )
guiLabelSetColor ( playerListLabels[k][6], pr, pg, pb )
end
end
end
end
end
function getPingColor ( ping )
if ping <= 50 then
return 0, 200, 0
elseif ping <= 150 then
return 200, 200, 0
else
return 200, 0, 0
end
end
function playerListScrollDown ()
if curPlayerListPosition < playerCount - maxPlayersInCurList + playersToScrollPerButton then
curPlayerListPosition = curPlayerListPosition + playersToScrollPerButton
else
curPlayerListPosition = playerCount
end
reFillPlayerList ()
end
function playerListScrollUp ()
if curPlayerListPosition > playersToScrollPerButton then
curPlayerListPosition = curPlayerListPosition - playersToScrollPerButton
else
curPlayerListPosition = 1
end
reFillPlayerList ()
end
function playerListKeyPressed ( key, state )
if state == "down" then
radioUpState = isControlEnabled ( "radio_next" )
radioDownState = isControlEnabled ( "radio_previous" )
weaponUpState = isControlEnabled ( "next_weapon" )
weaponDownState = isControlEnabled ( "previous_weapon" )
toggleControl ( "radio_next", false )
toggleControl ( "radio_previous", false )
toggleControl ( "next_weapon", false )
toggleControl ( "previous_weapon", false )
if isTimer ( playerListUpdateTimer ) then
killTimer ( playerListUpdateTimer )
end
scollBarAdjustTimer = setTimer ( reAdjustPlayerListScollBar, 50, -1 )
bindKey ( "mouse_wheel_up", "down", playerListScrollUp )
bindKey ( "mouse_wheel_down", "down", playerListScrollDown )
showPlayerList ()
else
toggleControl ( "radio_next", radioUpState )
toggleControl ( "radio_previous", radioDownState )
toggleControl ( "next_weapon", weaponUpState )
toggleControl ( "previous_weapon", weaponDownState )
killTimer ( scollBarAdjustTimer )
unbindKey ( "mouse_wheel_up", "down", playerListScrollUp )
unbindKey ( "mouse_wheel_down", "down", playerListScrollDown )
guiSetVisible ( gImage["playerList"], false )
end
end
bindKey ( "tab", "both", playerListKeyPressed )
addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), prem )
Alles anzeigen
Ich habe ein Scoreboard Bild erstellt für VIP, allerdings wenn der Spieler offline geht bleibt das Bild dort erhalten. Bitte um Hilfe!
function clientPlayerListDisconnect ()
local i = playersOnlineData[source]
playersOnline[i] = nil
playerCount = playerCount - 1
end
addEventHandler ( "onClientPlayerQuit", getRootElement(), clientPlayerListDisconnect )
Das ist die Disconnect Funktion.
if getElementData ( index, "prem" ) == 1 then
playerListLabels[k][7] = guiCreateStaticImage(10,95 - 20 + 20 * i,40,35,"images/nametag/premium.png",false,gImage["playerList"])
end
Das ist die Funktion, womit das Bild erstellt wird.
Ja schon aber wenn jetzt andere VIP haben wird das doch immer wieder vor meinen Namen gesetzt.
Hier:
Nicht wundern das, dass Scoreboard so ein bisschen durcheinander ist.
Das VIP Bild wird ja nun nur vor meinen Namen gesetzt, weil es ja nur eine Koordinate gibt.
Klappt nun irgendwie. Also wenn ich kein Premium bin kommt kein "VIP Bild" im Scoreboard und wenn ich Premium bin schon. Nur wie mache ich das nun das es immer vor dem Spieler Namen gesetzt wird?
Nun kommt "Info: boolean".
Da kommt dann "INFO:" und mit dem guiCreateStaticImage klappt es.
Es werden beide benutzt und nach Errors guck ich im "debugscript 3". Ich wüsste sonst nicht was du damit meinst.
Ich wusste nicht genau was du damit meintest, Sorry.
"Welches von beiden wird benutzt?"
"Und wo haste nach Errors gesucht?"