Author Topic: How to access UTime hours.  (Read 11300 times)

0 Members and 2 Guests are viewing this topic.

Offline Aharon Tager

  • Newbie
  • *
  • Posts: 37
  • Karma: 0
    • Barely Legal Gaming
How to access UTime hours.
« on: August 15, 2015, 09:35:08 PM »
Hey, I'm trying to make a command to view a players hours on a server with ulx and utime installed. I don't have access to a test server, so I was wondering if anyone could look this over and see if it'll work.
Code: [Select]
local CATEGORY_NAME = UTime

function ulx.viewHours (calling_ply, target_ply)
local hours = target_ply:GetUTimeTotalTime() / 3600
ULib.tsay(calling_ply, "#A's hours: " ..hours.., target_ply)
end

local seehours = ulx.command(CATEGORY_NAME, "ulx viewhours", ulx.viewHours, "!viewhours")
seehours:addParam:(type=ULib.cmds.PlayerArg)
seehours:defaultAccess( ULib.ACCESS_ADMIN )
seehours:help("View a player's hours on the server.")

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given