Ulysses Stuff > Releases
Utime Hour Changer Addon :) [2.18v]
DendeSon:
Any way to view a players time using this if the player is not on the server?
Bite That Apple:
Nope, sorry. That would be impossible.
orrila:
--- Quote from: DendeSon on December 23, 2013, 02:51:16 PM ---Any way to view a players time using this if the player is not on the server?
--- End quote ---
Not with this, but certainly with some changes to Utime, or looking in logs or something.
Chironex:
I did exactly the same thing as this addon few days ago...
Anyway, I looked your script and didn't understand why you made it so complex. Here is mine:
--- Code: ---if file.Exists("autorun/cl_utime.lua", "LUA") then
function ulx.sethours( calling_ply, target_plys, hours )
for i=1, #target_plys do
local v = target_plys[ i ]
local removeSessionTime = true
if ( hours < 0 ) then
hours = math.max( ( v:GetUTime() / 3600 ) + hours, 0 )
removeSessionTime = false
end
local time = (hours * 3600)
if ( removeSessionTime ) then
time = time - (time % 3600) - v:GetUTimeSessionTime()
end
v:SetUTime( time )
end
ulx.fancyLogAdmin( calling_ply, "#A set #T's hours to #i", target_plys, hours )
end
local sethours = ulx.command( "User Management", "ulx sethours", ulx.sethours, "!sethours" )
sethours:addParam{ type=ULib.cmds.PlayersArg }
sethours:addParam{ type=ULib.cmds.NumArg, min = -10000, max = 10000, default = 0, hint = "hours", ULib.cmds.optional, ULib.cmds.round }
sethours:defaultAccess( ULib.ACCESS_ADMIN )
sethours:help( "Sets target(s)'s UTime hours." )
end
--- End code ---
Negative value will remove hours ;)
Bite That Apple:
--- Quote from: Chironex on March 18, 2014, 11:39:36 PM ---I did exactly the same thing as this addon few days ago...
Anyway, I looked your script and didn't understand why you made it so complex. Here is mine:
--- Code: ---if ( file.Exists("autorun/cl_utime.lua", "LUA") ) then
function ulx.sethours( calling_ply, target_plys, hours )
for ( i = 1, #target_plys ) do
local target_ply = target_plys[ i ]
if ( hours < 0 ) then
hours = math.max( ( target_ply:GetUTime() / 3600 ) + hours, 0 )
end
target_ply:SetUTime( hours * 3600 )
end
ulx.fancyLogAdmin( calling_ply, "#A set #T's hours to #i", target_plys, hours )
end
local sethours = ulx.command( "User Management", "ulx sethours", ulx.sethours, "!sethours" )
sethours:addParam{ type = ULib.cmds.PlayersArg }
sethours:addParam{ type = ULib.cmds.NumArg, min = -10000, max = 10000, default = 0, hint = "hours", ULib.cmds.optional, ULib.cmds.round }
sethours:defaultAccess( ULib.ACCESS_ADMIN )
sethours:help( "Sets target(s)'s UTime hours." )
end
--- End code ---
Negative value will remove hours ;)
--- End quote ---
I made mine special for a mysql utime, and I just never removed the other code, as it didn't really affect the people who were using mysql lite servers
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version