Guten Tag Liebe Community,
ich habe ein neues Tab eingefügt von einem anderen Script, das Problem ist das es oben links in der ecke
http://www.pic-upload.de/view-26607608/…-19-50.png.html
Hier ist Debugscript und der fehler drauf.
und so habe ich es in der playerlist_client.lua stehen:
Spoiler anzeigen
Lua
local playerListLabels = {}
local playerListFactionMembersLabel = {}
local playersOnline = {}
local playersOnlineData = {}
local curPlayerListPosition = 1
local playerCount = 0
local playerListWidth = 667
local playerListHeight = 311
local maxPlayersInCurList = 17
local maxPlayers = 40
local playersToScrollPerButton = 10
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 = 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 = 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,"colors/tab.jpg",false)
guiSetAlpha(gImage["playerList"],0.75)
label = guiCreateLabel(12,9,51,23," by Provider" style="border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background-image: initial !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">Spieler",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
img = guiCreateStaticImage(8,23,645,5,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
label = guiCreateLabel(165,8,88,23,"Sozialer Status",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
label = guiCreateLabel(278,7,52,20,"Spielzeit",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
img = guiCreateStaticImage(151,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
img = guiCreateStaticImage(265,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
label = guiCreateLabel(346,8,62,16,"HandyNr.",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
img = guiCreateStaticImage(333,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
img = guiCreateStaticImage(413,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
label = guiCreateLabel(439,8,35,15,"Ping",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
img = guiCreateStaticImage(481,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
label = guiCreateLabel(500,8,45,15,"Arbeit",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
img = guiCreateStaticImage(570,28,3,268,"images/colors/c_red.jpg",false,gImage["playerList"])
guiSetAlpha(img,0.7)
label = guiCreateLabel(590,8,62,16,"Fraktion",false,gImage["playerList"])
guiSetAlpha(label,1)
guiLabelSetColor(label,255,255,255)
guiLabelSetVerticalAlign(label,"top")
guiLabelSetHorizontalAlign(label,"left",false)
guiSetFont(label,"default-bold-small")
gImage["playerListBarBG"] = guiCreateStaticImage(655,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(8,296,100,18,"0/"..maxPlayers.." by Provider" style="border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background-image: initial !important; background-attachment: initial !important; background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">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"],"default-bold-small")
gLabel["playerListMaker"] = guiCreateLabel(396,296,262,18,"German SERVERNAME Reallife 2.0 - MTA Reallife",false,gImage["playerList"])
guiSetAlpha(gLabel["playerListMaker"],1)
guiLabelSetColor(gLabel["playerListMaker"],255,255,255)
guiLabelSetVerticalAlign(gLabel["playerListMaker"],"top")
guiLabelSetHorizontalAlign(gLabel["playerListMaker"],"left",false)
guiSetFont(gLabel["playerListMaker"],"default-bold-small")
for i, index in pairs ( factionColors ) do
if i > 0 then
local r, g, b = factionColors[1], factionColors[2], factionColors[3]
playerListFactionMembersLabel = guiCreateLabel(8+75+(i)*20,296,20,18,"",false,gImage["playerList"])
guiSetAlpha(playerListFactionMembersLabel,1)
guiLabelSetColor(playerListFactionMembersLabel,r,g,b)
guiLabelSetVerticalAlign(playerListFactionMembersLabel,"top")
guiLabelSetHorizontalAlign(playerListFactionMembersLabel,"left",false)
guiSetFont(playerListFactionMembersLabel,"default-bold-small")
end
end
for i = 1, maxPlayersInCurList do
playerListLabels = {}
playerListLabels[1] = guiCreateLabel(10,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[2] = guiCreateLabel(155,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[3] = guiCreateLabel(270,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[4] = guiCreateLabel(338,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[5] = guiCreateLabel(418,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[6] = guiCreateLabel(488,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
playerListLabels[7] = guiCreateLabel(582,30 - 15 + 15 * i,141,16,"",false,gImage["playerList"])
for k = 1, 7 do
guiSetAlpha(playerListLabels[k],1)
guiLabelSetColor(playerListLabels[k],255,255,255)
guiLabelSetVerticalAlign(playerListLabels[k],"top")
guiLabelSetHorizontalAlign(playerListLabels[k],"left",false)
guiSetFont(playerListLabels[k],"default-bold-small")
end
guiLabelSetColor ( playerListLabels[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 then
factionCounter = {}
end
factionCounter[index] = true
end
end
for i, index in pairs ( factionColors ) do
if playerListFactionMembersLabel then
local length = tableLength ( factionCounter )
if length > 0 then
guiSetText ( playerListFactionMembersLabel, length )
else
guiSetText ( playerListFactionMembersLabel, "" )
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
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, 7 do
guiSetText ( playerListLabels[key], "" )
end
end
local i = 0
local k = 0
local name, rang, playingtime, ping, job,frak, r, g, b
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" )
ping = tonumber ( getPlayerPing ( index ) )
job = getElementData ( index, "job" )
frak = getElementData ( index, "fraktion" )
if not rang then
rang = "Verbindungsaufbau"
nr = ""
playingtime = ""
job = ""
frak = ""
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 )
job = getElementData ( index, "job" )
if job == "fischer" then
job = "Fischer"
elseif job == "airport" then
job = "Flughafen"
elseif job == "dealer" then
job = "Dealer"
elseif job == "taxifahrer" then
job = "Taxifahrer"
elseif job == "hotdog" then
job = "Hotdog"
elseif job == "streetclean" then
job = "Reinigung"
elseif job == "transporteur" then
job = "Trucker"
elseif job == "mechaniker" then
job = "Mechaniker"
elseif job == "bus" then
job = "Busfahrer"
elseif job == "wdealer" then
job = "Waffendealer"
elseif job == "farmer" then
job = "Farmer"
elseif job == "gabelstablerjob" then
job = "Gabelstablerfahrer"
elseif job == "feuerwehrmann" then
job = "Feuerwehrmann"
elseif job == "shoptrucker" then
job = "Shoplieferant"
elseif job == "gastrucker" then
job = "Tankstellenlieferant"
elseif job == "baulieferant" then
job = "Baulieferant"
elseif job == "bauarbeiter" then
job = "Bauarbeiter"
elseif job == "none" then
job = "Arbeitslos"
end
frak = getElementData ( index, "fraktion" )
if frak == 0 then
frak = "Zivilist"
elseif frak == 1 then
frak = "LSPD"
elseif frak == 2 then
frak = "Mafia"
elseif frak == 3 then
frak = "Triaden"
elseif frak == 4 then
frak = "Terror"
elseif frak == 5 then
frak = "Reporter"
elseif frak == 6 then
frak = "F.B.I"
elseif frak == 7 then
frak = "Aztecas"
elseif frak == 8 then
frak = "Bundeswehr"
elseif frak == 9 then
frak = "Angels of Death"
end
if vioGetElementData ( index, "adminlvl" ) >= 1 then
name = "[TR] "..name
else
name = name
end
end
guiSetText ( playerListLabels[k][1], name )
guiSetText ( playerListLabels[k][2], rang )
guiSetText ( playerListLabels[k][3], playingtime )
guiSetText ( playerListLabels[k][4], nr )
guiSetText ( playerListLabels[k][5], ping )
guiSetText ( playerListLabels[k][6], job )
guiSetText ( playerListLabels[k][7], frak )
pr, pg, pb = getPingColor ( ping )
guiLabelSetColor ( playerListLabels[k][1], r, g, b )
guiLabelSetColor ( playerListLabels[k][5], 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_prelaus" )
weaponUpState = isControlEnabled ( "next_weapon" )
weaponDownState = isControlEnabled ( "previous_weapon" )
weaponAimState = isControlEnabled ( "aim_weapon" )
weaponShootState = isControlEnabled ( "fire" )
toggleControl ( "radio_next", false )
toggleControl ( "radio_prelaus", false )
toggleControl ( "next_weapon", false )
toggleControl ( "previous_weapon", false )
toggleControl ( "aim_weapon", false)
toggleControl ( "fire", 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_prelaus", radioDownState )
toggleControl ( "next_weapon", weaponUpState )
toggleControl ( "previous_weapon", weaponDownState )
toggleControl ( "aim_weapon", weaponAimState )
toggleControl ( "fire", weaponShootState )
killTimer ( scollBarAdjustTimer )
unbindKey ( "mouse_wheel_up", "down", playerListScrollUp )
unbindKey ( "mouse_wheel_down", "down", playerListScrollDown )
guiSetVisible ( gImage["playerList"], false )
end
endbindKey ( "tab", "both", playerListKeyPressed )
Alles anzeigen
[i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i]
Kann mir da jemand helfen??
Yours Faithfully
GermanMaster
P.S ich werde es noch mit den Job´s bearbeiten da es nicht alle sind.[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]