Szerző Téma: Státusz  (Megtekintve 833 alkalommal)

Státusz
« Dátum: 2016. Augusztus 15. - 18:06:09 »
0 Show voters
Helló, láttam már sok szerveren hogy a jobb alsó sarkok-ban ki van írva a szerver neve a szerveren töltött idő pl:(1 óra 30 perc 10 másodperc) a dátumot stb.. ezt hogy lehet megcsinálni?

Nem elérhető AnthonyGates

  • 546
  • AnthonyGates
    • Profil megtekintése
Státusz
« Válasz #1 Dátum: 2016. Augusztus 15. - 18:22:57 »
0 Show voters
Textdraw
Timer
TextDrawSetString

Státusz
« Válasz #2 Dátum: 2016. Augusztus 15. - 18:25:36 »
+1 Show voters
Idézetet írta: impreZZa date=1471248647\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"62665\" data-ipsquote-contentclass=\"forums_Topic

\"903008fcc0e34ec0900c9b7764a51272.png\"

[/quote]
https://wiki.multitheftauto.com/wiki/DxDrawText
https://wiki.multitheftauto.com/wiki/GetElementData

Státusz
« Válasz #3 Dátum: 2016. Augusztus 16. - 02:45:30 »
0 Show voters
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)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal