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

Wysłany: 2013-03-27, 21:11


Seba978







Wiek: 33
Na forum: 4818 dni
Posty: 9
Nick w MP: kolo



Respekt: 50

Mam problem czemu m?j scoreboard nie chce dzia?a???

oto scoreboard_http:
Kod:


local httpColumns = {}
local httpRows = {}
local updateInterval = 1000

function getScoreboardColumns( )
return httpColumns
end

function getScoreboardRows( )
return httpRows
end

local function getName(element)
local etype = getElementType(element)

if etype == "player" then
return getClientName(element)
elseif etype == "team" then
return getTeamName(element)
end
end

local function getRowData( element )
local rowData = {getElementType(element),}
for i, column in ipairs(httpColumns) do
if column.name == "name" then
table.insert(rowData, getName(element))
elseif column.name == "ping" then
local ping = ""
if getElementType(element) == "player" then
ping = getPlayerPing(element)
end
table.insert(rowData, ping)
else
table.insert(rowData, getElementData(element,column.name) or "")
end
end

return rowData
end

local function refreshServerScoreboard()
local scoreboardNewColumns = {}

for i, column in ipairs(scoreboardColumns) do
local visibleToElement = column.visibleTo
if visibleToElement == nil or visibleToElement == rootElement then
table.insert(scoreboardNewColumns,{name=column.name,size=column.size})
end
end

httpColumns = scoreboardNewColumns

local scoreboardNewRows = {}

for i, player in ipairs(getElementsByType("player")) do
if not getPlayerTeam(player) then
table.insert(scoreboardNewRows,getRowData(player))
end
end

for i,team in ipairs(getElementsByType("team")) do
table.insert(scoreboardNewRows,getRowData(team))
for i,player in ipairs(getPlayersInTeam(team)) do
table.insert(scoreboardNewRows,getRowData(player))
end
end

httpRows = scoreboardNewRows
end

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),
function()
setTimer(refreshServerScoreboard, updateInterval, 0)
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-07, 10:56


PanGrzybulek







Wiek: 28
Na forum: 4823 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
Nie prosciej bylo by zreinstalowac maszyne? Mowie tak poniewaz scoreboard jest juz wgrany w mta oryginalnie i by ci samo blad naprawilo.

Postaw piwo autorowi tego posta
 

 
Tagi: scoreboard
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » scoreboard 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