• Print

Author Topic: A little help with Utime? :)  (Read 5473 times)

0 Members and 1 Guest are viewing this topic.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
A little help with Utime? :)
« on: July 09, 2013, 10:39:44 am »
Hi Ulysses

I'm been seeking help with some Utime and I have been advised to go to your forums :D

Well this is actually a remake on my post on facepunch :D
------------------------------------------------------------------------------------------------------------------
I'm having some problems with Utime to ULX because:

I wanted a autopromotion addon which... auto promote... well I found one and its based on Utime.

So I downloaded those 2 and installed the addons and it seems that the autopromote works fine but I'm having some problems with the Utime. It Seems that the Utime sometimes kick random players first time they join and I'm getting these errors :D http://gyazo.com/ff6c3481c42e5a2a5bbf1e860c146973

I can see it first of all Is something wrong with line 310:

Info: I set the scales of the menus to be 0 so it "invisible" or "not there" because I don't want it on my screen :D. if you think it have something to do with the problem then just say it and i try to redo it :)

Code: Lua
  1. ----------------------------------------------------------------------------------------------------------
  2. -- Now for the control panels!
  3. ----------------------------------------------------------------------------------------------------------
  4.  
  5. function resetCvars()
  6.                 RunConsoleCommand( "utime_outsidecolor_r", "0" )
  7.                 RunConsoleCommand( "utime_outsidecolor_g", "150" )
  8.                 RunConsoleCommand( "utime_outsidecolor_b", "245" )
  9.            
  10.                 RunConsoleCommand( "utime_outsidetext_r", "255" )
  11.                 RunConsoleCommand( "utime_outsidetext_g", "255" )
  12.                 RunConsoleCommand( "utime_outsidetext_b", "255" )
  13.            
  14.                 RunConsoleCommand( "utime_insidecolor_r", "250" )
  15.                 RunConsoleCommand( "utime_insidecolor_g", "250" )
  16.                 RunConsoleCommand( "utime_insidecolor_b", "245" )
  17.            
  18.                 RunConsoleCommand( "utime_insidetext_r", "0" )
  19.                 RunConsoleCommand( "utime_insidetext_g", "0" )
  20.                 RunConsoleCommand( "utime_insidetext_b", "0" )
  21.            
  22.                 RunConsoleCommand( "utime_pos_x", "98" )
  23.                 RunConsoleCommand( "utime_pos_y", "8" )
  24.                 buildCP( controlpanel.Get( "Utime" ) )
  25. end
  26. concommand.Add( "utime_reset", resetCvars )
  27.  
  28. function buildCP( cpanel )
  29. (line 310)      cpanel:ClearControls()
  30.                 cpanel:AddControl( "Header", { Text = "UTime by Megiddo (Team Ulysses)" } )
  31.                 cpanel:AddControl( "Checkbox", { Label = "Enable", Command = "utime_enable" }  )
  32.                 cpanel:AddControl( "Slider", { Label = "Position X", Command = "utime_pos_x", Type = "Float", Min = "0", Max = "100" }  )
  33.                 cpanel:AddControl( "Slider", { Label = "Position Y", Command = "utime_pos_y", Type = "Float", Min = "0", Max = "100" }  )          
  34.                 cpanel:AddControl( "Color", { Label = "Outside Color", Red = "utime_outsidecolor_r", Green = "utime_outsidecolor_g", Blue = "utime_outsidecolor_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" }  )
  35.                 cpanel:AddControl( "Color", { Label = "Outside Text Color", Red = "utime_outsidetext_r", Green = "utime_outsidetext_g", Blue = "utime_outsidetext_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" }  )
  36.                 cpanel:AddControl( "Color", { Label = "Inside Color", Red = "utime_insidecolor_r", Green = "utime_insidecolor_g", Blue = "utime_insidecolor_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" }      )
  37.                 cpanel:AddControl( "Color", { Label = "Inside Text Color", Red = "utime_insidetext_r", Green = "utime_insidetext_g", Blue = "utime_insidetext_b", ShowAlpha = "0", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" }  )           
  38.                 cpanel:AddControl( "Button", { Text = "Reset", Label = "Reset colors and position", Command = "utime_reset" } )
  39. end
  40.  
  41. function spawnMenuOpen()
  42.                 buildCP( controlpanel.Get( "Utime" ) )
  43. end
  44. hook.Add( "SpawnMenuOpen", "UtimeSpawnMenuOpen", spawnMenuOpen )
  45.  
  46. function popToolMenu()
  47.                 spawnmenu.AddToolMenuOption( "Utilities", "Utime Controls", "Utime", "Utime", "", "", buildCP )
  48. end
  49. hook.Add( "PopulateToolMenu", "UtimePopulateTools", popToolMenu )
  50.  
  51. function onEntCreated( ent )
  52.                 if LocalPlayer():IsValid() then -- LocalPlayer was created and is valid now
  53.                                 if utime_outsidecolor_r:GetInt() == 256 then resetCvars() end
  54.                 end
  55. end
  56. hook.Add( "OnEntityCreated", "UTimeLocalPlayerCheck", onEntCreated ) -- Flag server when we created LocalPlayer()

INFO!: My line 310 is line 29 here when you're looking at it :)

Any help or idea will be helpful and thanks for using you time on my silly little thread :)

Thanks :)

Edit: I can post the whole code if it will help you helping me :P

2Edit: this is my first Ulysses thread so plz spare with me :P

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: A little help with Utime? :)
« Reply #1 on: July 09, 2013, 11:42:09 am »
Don't worry about us tearing you to pieces, you created a very good thread. And thanks for using a Lua codeblock, even though it's not really explained anywhere.

I wasn't able to duplicate this error in my limited test (deleted gmod first), and the error doesn't make sense. The error is saying to call that function in a hook... but that's where it's being called from.

I don't really have any solution for you except to set the cvar "sv_kickerrornum" to 0 so that users aren't kicked when this error occurs.
Experiencing God's grace one day at a time.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #2 on: July 09, 2013, 11:51:22 am »
Thanks you  ;)

Well I think I will do that as a temp. fix :)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: A little help with Utime? :)
« Reply #3 on: July 09, 2013, 04:04:16 pm »
Morten, many months(years?) ago, I think UTime used to not use a hook.
Can you show us where you got your UTime/Apromote from?
There are several floating about, and you might have a bit older one.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: A little help with Utime? :)
« Reply #4 on: July 09, 2013, 06:02:55 pm »
JamminR, the line numbers match up, so I'm pretty sure he's using the latest. Worth verifying, though.
Experiencing God's grace one day at a time.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #5 on: July 10, 2013, 01:32:12 am »
I got my Utime from /index.php/topic,3039.0.html which I hope is the latest? :D.... I can also Edit my Thread so the whole code will be written insted of only that part? If that would help anything? :)

If its somehow not the latest version of Utime then plz direct me to the right one because I have not been able to find another one :P

Thanks for your help and time :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: A little help with Utime? :)
« Reply #6 on: July 10, 2013, 08:57:45 am »
Nope, that's the right one. I don't understand why it's giving you those errors. I tried to replicated it a few more times on my end with no luck.
Experiencing God's grace one day at a time.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #7 on: July 10, 2013, 01:31:37 pm »
I have really no idea? :D

But thanks for your time. Its highly apreciated  ;)

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: A little help with Utime? :)
« Reply #8 on: July 10, 2013, 08:31:33 pm »
I'm curious. What is this "CPanel"/"Control Panel" (it's basically the same thing) the error is "talking" about?
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #9 on: July 11, 2013, 07:33:01 am »
I'm curious. What is this "CPanel"/"Control Panel" (it's basically the same thing) the error is "talking" about?

I'm Sorry. I cant answer you on your question :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: A little help with Utime? :)
« Reply #10 on: July 11, 2013, 09:10:39 am »
It's the control panel in the spawn menu.
Experiencing God's grace one day at a time.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #11 on: July 11, 2013, 12:06:42 pm »
Hmm Maybe I Could upload my Utime some were?? because I have "edit" in it. I edited so the menues is invisible when you aim at someone. Maybe that could be it??

Tell me what you think :)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: A little help with Utime? :)
« Reply #12 on: July 11, 2013, 12:29:10 pm »
No, that wouldn't be the cause, I don't think.
Experiencing God's grace one day at a time.

Offline morten7000

  • Newbie
  • *
  • Posts: 39
  • Karma: -1
Re: A little help with Utime? :)
« Reply #13 on: July 13, 2013, 08:45:39 am »
Hey guyz. I just uploaded my "Utime" file to dropbox (first time I ever use dropbox. So if anything is wrong with the link then tell me :D )

Here is a link to where you guyz can download it as a .zip :) Hope you can help me :)

https://www.dropbox.com/sh/vz5fdg1qym24n46/CsGKcr_xgy

  • Print