Ulysses Stuff > Releases
Utime -- Show how long your players have been connected this session and total
krooks:
Thanks for porting this over to 13, I may have found a bug while changing the position values in resetCvars, then entering utime_reset in game, I get:
--- Code: ---] utime_reset
Warning: vgui.Create failed to create the VGUI component (ControlPanel)
Trace:
1: Line 32 "Trace" lua/includes/extensions/debug.lua
2: Line 13 "Get" lua/includes/modules/controlpanel.lua
3: Line 305 "nil" addons/utime/lua/autorun/cl_utime.lua
4: Line 69 "nil" lua/includes/modules/concommand.lua
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. unknown - addons/utime/lua/autorun/cl_utime.lua:305
3. unknown - lua/includes/modules/concommand.lua:69
--- End code ---
Note, this is a TTT server.
krooks:
It seems to be happening to people who join for the first time, here's what I get in clientside_errors.txt
--- Code: ---[ERROR] addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
1. buildCP - addons/utime/lua/autorun/cl_utime.lua:310
2. resetCvars - addons/utime/lua/autorun/cl_utime.lua:305
3. fn - addons/utime/lua/autorun/cl_utime.lua:334
4. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
5. GetAll - [C]:-1
6. fn - addons/ulx/lua/ulx/modules/sh/chat.lua:245
7. Call - addons/ulib/lua/ulib/shared/hook.lua:168
8. fn - addons/ulib/lua/ulib/cl_init.lua:40
9. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
10. LocalPlayer - [C]:-1
11. fn - addons/ulib/lua/ulib/cl_init.lua:39
12. unknown - addons/ulib/lua/ulib/shared/hook.lua:168
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
--- End code ---
And this is the block I changed, starting on line 286 of cl_utime.lua
--- Code: ---function resetCvars()
RunConsoleCommand( "utime_outsidecolor_r", "40" )
RunConsoleCommand( "utime_outsidecolor_g", "40" )
RunConsoleCommand( "utime_outsidecolor_b", "40" )
RunConsoleCommand( "utime_outsidetext_r", "255" )
RunConsoleCommand( "utime_outsidetext_g", "255" )
RunConsoleCommand( "utime_outsidetext_b", "255" )
RunConsoleCommand( "utime_insidecolor_r", "250" )
RunConsoleCommand( "utime_insidecolor_g", "250" )
RunConsoleCommand( "utime_insidecolor_b", "245" )
RunConsoleCommand( "utime_insidetext_r", "0" )
RunConsoleCommand( "utime_insidetext_g", "0" )
RunConsoleCommand( "utime_insidetext_b", "0" )
RunConsoleCommand( "utime_pos_x", "1" )
RunConsoleCommand( "utime_pos_y", "90" )
buildCP( controlpanel.Get( "Utime" ) )
end
concommand.Add( "utime_reset", resetCvars )
--- End code ---
Just the default color and position. Is this the wrong place to change such things?
delagious:
I am getting an issue when people reach 96 hours(4 days) of playtime with this addon.
Whenever someone on my server reaches that time they get 1 week added to their time.
So instead of displaying
--- Code: ---00w 04d 0h 00m 00s
--- End code ---
it displays
--- Code: ---01w 04d 0h 00m 00s
--- End code ---
The same error occurs when they reach 264 hours(11 days).
So instead of displaying
--- Code: ---01w 04d 0h 00m 00s
--- End code ---
it adds a week and displays
--- Code: ---02w 04d 0h 00m 00s
--- End code ---
Why does it add this extra week when they reach the 4th, 11th, 18th, etc... day of total playtime?
Megiddo:
--- Quote from: delagious on January 25, 2013, 07:22:10 PM ---I am getting an issue when people reach 96 hours(4 days) of playtime with this addon.
Whenever someone on my server reaches that time they get 1 week added to their time.
So instead of displaying
--- Code: ---00w 04d 0h 00m 00s
--- End code ---
it displays
--- Code: ---01w 04d 0h 00m 00s
--- End code ---
The same error occurs when they reach 264 hours(11 days).
So instead of displaying
--- Code: ---01w 04d 0h 00m 00s
--- End code ---
it adds a week and displays
--- Code: ---02w 04d 0h 00m 00s
--- End code ---
Why does it add this extra week when they reach the 4th, 11th, 18th, etc... day of total playtime?
--- End quote ---
Wow, not sure how that happened. It will be fixed shortly.
@Krooks, I'm not getting that error using GitHub version of UTime. I deleted my garrysmod folder to simulate a first join, but got no error. I also see no difference (except values) in the code you posted.
Megiddo:
Updated:
--- Quote from: Changelog ---v1.42 - *(01/27/13)*
* [ADD] utime_welcome cvar to disable welcome message.
* [FIX] Regular slew of bugs introduced by Garry (MAJOR thanks TweaK!).
* [FIX] Time string calculations being incorrect (Thanks delagious).
--- End quote ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version