After installing Utime into my TTT server im getting the following errror some playerside
[lua]
Froggit|335|xxx
controlpanel.Get() - Error creating a ControlPanel!
You're calling this function too early! Call it in a hook!
Froggit|335|xxx
ERROR: Hook 'UTimeLocalPlayerCheck' Failed: addons/utime/lua/autorun/cl_utime.lua:310: attempt to index local 'cpanel' (a nil value)
Froggit|335|xxx
Removing Hook 'UTimeLocalPlayerCheck'
[/lua]
Here is Utime files that the error s apparently coming from
[lua]
-- Written by Team Ulysses, [url]http://ulyssesmod.net/[/url]
module( "Utime", package.seeall )
if not CLIENT then return end
local gpanel
--Now convars!
local utime_enable = CreateClientConVar( "utime_enable", "1.0", true, false )
local utime_outsidecolor_r = CreateClientConVar( "utime_outsidecolor_r", "256.0", true, false )
local utime_outsidecolor_g = CreateClientConVar( "utime_outsidecolor_g", "256.0", true, false )
local utime_outsidecolor_b = CreateClientConVar( "utime_outsidecolor_b", "256.0", true, false )
local utime_outsidetext_r = CreateClientConVar( "utime_outsidetext_r", "0.0", true, false )
local utime_outsidetext_g = CreateClientConVar( "utime_outsidetext_g", "0.0", true, false )
local utime_outsidetext_b = CreateClientConVar( "utime_outsidetext_b", "0.0", true, false )
local utime_insidecolor_r = CreateClientConVar( "utime_insidecolor_r", "256.0", true, false )
local utime_insidecolor_g = CreateClientConVar( "utime_insidecolor_g", "256.0", true, false )
local utime_insidecolor_b = CreateClientConVar( "utime_insidecolor_b", "256.0", true, false )
local utime_insidetext_r = CreateClientConVar( "utime_insidetext_r", "0", true, false )
local utime_insidetext_g = CreateClientConVar( "utime_insidetext_g", "0", true, false )
local utime_insidetext_b = CreateClientConVar( "utime_insidetext_b", "0", true, false )
local utime_pos_x = CreateClientConVar( "utime_pos_x", "0.0", true, false )
local utime_pos_y = CreateClientConVar( "utime_pos_y", "0.0", true, false )
local PANEL = {}
PANEL.Small = 40
PANEL.TargetSize = PANEL.Small
PANEL.Large = 100
PANEL.Wide = 160
function initialize()
gpanel = vgui.Create( "UTimeMain" )
gpanel:SetSize( gpanel.Wide, gpanel.Small )
hook.Remove( "OnEntityCreated", "UtimeInitialize" )
end
hook.Add( "InitPostEntity", "UtimeInitialize", initialize )
function think()
if not LocalPlayer():IsValid() then return end
if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or
(IsValid( LocalPlayer():GetActiveWeapon() ) and LocalPlayer():GetActiveWeapon():GetClass() == "gmod_camera") then
gpanel:SetVisible( false )
else
gpanel:SetVisible( true )
end
--gpanel:SetPos( ScrW() - gpanel:GetWide() - 20, 20 )
gpanel:SetPos( (ScrW() - gpanel:GetWide()) * utime_pos_x:GetFloat() / 100, (ScrH() - gpanel.Large) * utime_pos_y:GetFloat() / 100 )
local textColor = Color( utime_outsidetext_r:GetInt(), utime_outsidetext_g:GetInt(), utime_outsidetext_b:GetInt(), 255 )
gpanel.lblTotalTime:SetTextColor( textColor )
gpanel.lblSessionTime:SetTextColor( textColor )
gpanel.total:SetTextColor( textColor )
gpanel.session:SetTextColor( textColor )
local insideTextColor = Color( utime_insidetext_r:GetInt(), utime_insidetext_g:GetInt(), utime_insidetext_b:GetInt(), 255 )
gpanel.playerInfo.lblTotalTime:SetTextColor( insideTextColor )
gpanel.playerInfo.lblSessionTime:SetTextColor( insideTextColor )
gpanel.playerInfo.lblNick:SetTextColor( insideTextColor )
gpanel.playerInfo.total:SetTextColor( insideTextColor )
gpanel.playerInfo.session:SetTextColor( insideTextColor )
gpanel.playerInfo.nick:SetTextColor( insideTextColor )
end
timer.Create( "UTimeThink", 0.6, 0, think )
local texGradient = surface.GetTextureID( "gui/center_gradient" )
--PANEL.InnerColor = Color( 250, 250, 245, 255 )
--PANEL.OuterColor = Color( 0, 150, 245, 200 )
-----------------------------------------------------------
-- Name: Paint
-----------------------------------------------------------
function PANEL:Paint(w,h)
local wide = self:GetWide()
local tall = self:GetTall()
local outerColor = Color( utime_outsidecolor_r:GetInt(), utime_outsidecolor_g:GetInt(), utime_outsidecolor_b:GetInt(), 200 )
draw.RoundedBox( 4, 0, 0, wide, tall, outerColor ) -- Draw our base
surface.SetTexture( texGradient )
surface.SetDrawColor( 255, 255, 255, 50 )
surface.SetDrawColor( outerColor )
surface.DrawTexturedRect( 0, 0, wide, tall ) -- Draw gradient overlay
if self:GetTall() > self.Small + 4 then -- Draw the white background for another player's info
local innerColor = Color( utime_insidecolor_r:GetInt(), utime_insidecolor_g:GetInt(), utime_insidecolor_b:GetInt(), 255 )
draw.RoundedBox( 4, 2, self.Small, wide - 4, tall - self.Small - 2, innerColor )
surface.SetTexture( texGradient )
surface.SetDrawColor( color_white )
surface.SetDrawColor( innerColor )
surface.DrawTexturedRect( 2, self.Small, wide - 4, tall - self.Small - 2 ) -- Gradient overlay
end
return true
end
-----------------------------------------------------------
-- Name: Init
-----------------------------------------------------------
function PANEL:Init()
self.Size = self.Small
self.playerInfo = vgui.Create( "UTimePlayerInfo", self )
self.lblTotalTime = vgui.Create( "DLabel", self )
self.lblSessionTime = vgui.Create( "DLabel", self )
self.total = vgui.Create( "DLabel", self )
self.session = vgui.Create( "DLabel", self )
end
-----------------------------------------------------------
-- Name: ApplySchemeSettings
-----------------------------------------------------------
function PANEL:ApplySchemeSettings()
self.lblTotalTime:SetFont( "DermaDefault" )
self.lblSessionTime:SetFont( "DermaDefault" )
self.total:SetFont( "DermaDefault" )
self.session:SetFont( "DermaDefault" )
self.lblTotalTime:SetTextColor( color_black )
self.lblSessionTime:SetTextColor( color_black )
self.total:SetTextColor( color_black )
self.session:SetTextColor( color_black )
end
-----------------------------------------------------------
-- Name: Think
-----------------------------------------------------------
local locktime = 0
function PANEL:Think()
if self.Size == self.Small then
self.playerInfo:SetVisible( false )
else
self.playerInfo:SetVisible( true )
end
local tr = util.GetPlayerTrace( LocalPlayer(), LocalPlayer():GetAimVector() )
local trace = util.TraceLine( tr )
if trace.Entity and trace.Entity:IsValid() and trace.Entity:IsPlayer() then
self.TargetSize = self.Large
self.playerInfo:SetPlayer( trace.Entity )
locktime = CurTime()
end
if locktime + 2 < CurTime() then
self.TargetSize = self.Small
end
if self.Size ~= self.TargetSize then
self.Size = math.Approach( self.Size, self.TargetSize, (math.abs( self.Size - self.TargetSize ) + 1) * 8 * FrameTime() )
self:PerformLayout()
end
self.total:SetText( timeToStr( LocalPlayer():GetUTimeTotalTime() ) )
self.session:SetText( timeToStr( LocalPlayer():GetUTimeSessionTime() ) )
end
-----------------------------------------------------------
-- Name: PerformLayout
-----------------------------------------------------------
function PANEL:PerformLayout()
self:SetSize( self:GetWide(), self.Size )
self.lblTotalTime:SetSize( 52, 18 )
self.lblTotalTime:SetPos( 8, 2 )
self.lblTotalTime:SetText( "Total: " )
self.lblSessionTime:SetSize( 52, 18 )
self.lblSessionTime:SetPos( 8, 20 )
self.lblSessionTime:SetText( "Session: " )
self.total:SetSize( self:GetWide() - 52, 18 )
self.total:SetPos( 52, 2 )
self.session:SetSize( self:GetWide() - 52, 18 )
self.session:SetPos( 52, 20 )
self.playerInfo:SetPos( 0, 42 )
self.playerInfo:SetSize( self:GetWide() - 8, self:GetTall() - 42 )
end
vgui.Register( "UTimeMain", PANEL, "Panel" )
local INFOPANEL = {}
-----------------------------------------------------------
--
UTime is not made for GMOD13.
[QUOTE=Ruzza;39255582]UTime is not made for GMOD13.[/QUOTE]
I'm pretty sure I read on the Ulysses forum that it only were a few errors and someone already fixed it in there.
I had a look around and didnt see any updates for that issue, does anyone know whats causing it ?
It is actually ported to gmod 13..
You're using this right? [url]https://github.com/Nayruden/Ulysses/tree/master/utime[/url]
Is ULib needed or not? I cant remember..
[QUOTE=Triple-X;39259232]Is ULib needed or not? I cant remember..[/QUOTE]
ULX relies on ULIB so yes.
[QUOTE=ms333;39258590]It is actually ported to gmod 13..
You're using this right? [url]https://github.com/Nayruden/Ulysses/tree/master/utime[/url][/QUOTE]
Yes thats the one im using :)
Ok, the reason its not working, as its not meant for a gamemode that doesnt have a Q menu. ULX utime was released 4 days ago to work with gmod 13. You will have to submit a request to make it TTT compatible which will include removing all cpanel things.
Not true. The gamemode I have works perfectly fine with utime. He must have some other script conflicting with utime.
The gamemode I use is stalker which also does not have a Q menu.
[url]http://i.imgur.com/DEpjb.png[/url]
[QUOTE=SqUiShEdMoNkEy;39265237]Ok, the reason its not working, as its not meant for a gamemode that doesnt have a Q menu. [/QUOTE]
Not true. It works for sandbox, which have a Q menu. Also, you don't need to port it to every single gamemode??
Sorry, you need to Log In to post a reply to this thread.