• Custom data values on ingame scoreboard?
    5 replies, posted
Hey. I downloaded a scoreboard online and I am trying to intergrate my own data values into it aside from the kills, ping, death, team and so on. Atm I'm trying to add the hours to the scoreboard and so far this is what I have: [IMG]http://oi59.tinypic.com/2u6cs1t.jpg[/IMG] Sorry if the code is a bit unclear but here is the line for the time to show on the scoreboard: [CODE] if ( lShowHours ) then draw.SimpleTextOutlined( Player:GetUTimeTotalTime(), "_ScoreboardLabel", self:GetWide() - 145, self:GetTall() / 2, Color( 238, 238, 238, 255 ), 1, 1, ( lOutline and 1 or 0 ), Color( 24, 24, 24, 255 ) ) end[/CODE] I am using uTime for this and the time is coming from the sv.db i have already from my previous server and is there anyway to format the time so that it shows the time on the server in HOURS and not seconds like it is doing now? [highlight](User was banned for this post ("Missed Developer Discussion/Possibly using leaks" - NiandraLades))[/highlight]
divide seconds by 3600 to get hours, might want to round it too so.
Hmm, so how would I structure the code for this?[QUOTE=Cushie;48205547]divide seconds by 3600 to get hours, might want to round it too so.[/QUOTE]
math.Round(Player:GetUTimeTotalTime()/3600, 0) with that being said, do you actually have the player's time stored on the client somewhere? if GetUTimeTotalTime() is the method to get it from sv.db on the server, it won't work on client.
Nah the sv.db is saved under the garrysmod directory on the server so any utime hour information is saved and stored on the server in that database file, but thanks for this :) [QUOTE=Cushie;48205733]math.Round(Player:GetUTimeTotalTime()/3600, 0) with that being said, do you actually have the player's time stored on the client somewhere? if GetUTimeTotalTime() is the method to get it from sv.db on the server, it won't work on client.[/QUOTE]
Wrong section it should be in Developer Discussion. Programming is for languages other than gLua
Sorry, you need to Log In to post a reply to this thread.