function secondsToTimeDesc( seconds )
if seconds then
local results = {}
local sec = ( seconds %60 )
local min = math.floor ( ( seconds % 3600 ) /60 )
local hou = math.floor ( ( seconds % 86400 ) /3600 )
local day = math.floor ( seconds /86400 )
if day > 0 and day < 10 then table.insert( results, day .. ( day == 1 and \" day\" or \" days\" ) )
elseif day > 0 then table.insert( results, day .. ( day == 1 and \"\" or \"\" ) ) end
if hou >= 0 and hou < 10 then table.insert( results, \"0\"..hou .. ( hou == 1 and \"\" or \"\" ) )
elseif hou > 0 then table.insert( results, hou .. ( hou == 1 and \"\" or \"\" ) ) end
if min >= 0 and min < 10 then table.insert( results, \"0\"..min .. ( min == 1 and \"\" or \"\" ) )
elseif min > 0 then table.insert( results, min .. ( hou == 1 and \"\" or \"\" ) ) end
if sec >= 0 and sec < 10 then table.insert( results, \"0\"..sec .. ( sec == 1 and \"\" or \"\" ) )
elseif sec > 0 then table.insert( results, sec .. ( sec == 1 and \"\" or \"\" ) ) end
return string.reverse ( table.concat ( results, \":\" ):reverse():gsub(\":\", \":\", 1 ) )
end
return \"\"
end
setElementData(localPlayer,\"onlineTime\",0)
setTimer(function()
setElementData(localPlayer,\"onlineTime\",getElementData(localPlayer,\"onlineTime\") + 1)
end,1000,0)
+ kiíratás
dxDrawText (secondsToTimeDesc(tonumber(getElementData(v, \"onlineTime\") or 0)), x,y, sizex, sizey, tocolor(255,255,255, 255), 1, font, \"left\", \"top\", false, false, true, true)