ULX

Author Topic: Help with UTime  (Read 1737 times)

0 Members and 1 Guest are viewing this topic.

Offline that1nub

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • My Website
Help with UTime
« on: November 24, 2017, 01:13:09 AM »
So I am fairly new to lua, and I tried to create a custom command for setting UTime, and it seemed to break my whole server. Here is my code:
Code: [Select]
function ulx.settime( calling_ply, target_ply, ammount )
target_ply:SetUTimeStart( ammount )
target_ply:SetUTime( ammount )
end
local settime = ulx.command( CATEGORY_NAME, "ulx settime", ulx.settime, "!settime" )
settime:addParam{ type=ULib.cmds.PlayerArg }
settime:AddParam{ type=ULib.cmds.NumArg min=0 max=2.628e+6 default=0, hint="Set the UTime of a player" }
What have I done that will break the server? The server is DarkRP, and this is what broke:
AtlasChat (displayed default chatbox instead)
Custom scoreboard and F4 menu didn't load
Removing this code seemed to fix it when I restarted the server.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Help with UTime
« Reply #1 on: November 24, 2017, 08:13:01 AM »
If it's breaking something, you're likely getting lua errors in server or game console.
We'd need to know what those are.

Random guess - "max=2.628e+6"
Did you actually set that? It might be confusing gmod lua, or even ULib numarg.

Also, check the Releases section of the forum - there are a few different releases that adjust UTime.
Even if they don't work anymore (I don't know if they do or don't), the commands in them will likely help you learn.
« Last Edit: November 24, 2017, 08:14:39 AM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming