kolumna = exports.scoreboard:scoreboardAddColumn("ID")
priorytet = exports.scoreboard:scoreboardSetColumnPriority("ID", 1, getRootElement())
local id = 0
function onJoin()
for w_g, gracz in ipairs(getElementsByType("player")) do
ids = getElementData(gracz, "ID")
end
if (setElementData(source,"ID", id+1) == true ) and not (ids == id+1) then
id = id+1
else
end
end
addEventHandler("onPlayerJoin", getRootElement(), onJoin)
function onQuit()
id1 = getElementData(source, "ID")
if id1 > id then
elseif id <= 1 then
id = 0
else
id = id1 - 1
end
end
addEventHandler("onPlayerQuit", getRootElement(), onQuit)
function ID()
for w_g, gracz in ipairs(getElementsByType("player")) do
ids = getElementData(gracz, "ID")
outputChatBox("ID"..getPlayerName(gracz)..": "..ids, source)
end
end
addCommandHandler("id", ID)
Potrzeba mi ?eby skrypt ten zapisywa? id na zawsze do jednego gracza
|