Ulysses Stuff > Releases
Utime -- Show how long your players have been connected this session and total
Megiddo:
--- Quote from: Botman on January 10, 2011, 08:47:35 AM ---Ugh, wouldn't it at least be possible to run some Lua command that orders an edit in the SQL file?
--- End quote ---
Yes, but you'd still need to know SQL. :P
Aaron113:
I have a simple setting command that I'd be willing to give you.
Botman:
--- Quote from: Aaron113 on January 10, 2011, 09:54:33 AM ---I have a simple setting command that I'd be willing to give you.
--- End quote ---
I would greatly appreciate it.
Megiddo:
--- Quote from: Aaron113 on January 10, 2011, 09:54:33 AM ---I have a simple setting command that I'd be willing to give you.
--- End quote ---
If you don't mind Aaron113, would you post it here for the future benefit of everyone? :)
Aaron113:
--- Code: ---local CATEGORY_NAME = "Custom"
function ulx.setutime( ply, targ, time )
if not targ:IsValid() then return end
targ:SetUTimeStart( CurTime() )
targ:SetUTime( time*3600 )
sql.Query( "INSET into utime( player, totaltime, lastvisit ) VALUES( ".. targ:UniqueID() ..",".. time*3600 ..",".. os.time() .." );" )
ulx.fancyLogAdmin( ply, "#A set the hour's for #T to #i", targ, time )
//return true
end
local setutime = ulx.command( CATEGORY_NAME, "ulx setutime", ulx.setutime, "!setutime" )
setutime:addParam{ type=ULib.cmds.PlayerArg, hint="player" }
setutime:addParam{ type=ULib.cmds.NumArg, default = 0, min = 0, max = 9999, hint="hours" }
setutime:defaultAccess( ULib.ACCESS_SUPERADMIN )
setutime:help( "Sets a player's hours." )
//setutime:logString( "#1s set the hour's for #2s to #3i" )
--- End code ---
Goes in your ULX/lua/ulx/modules/sh/
The commented out lines are for a few revisions back before the logging changed.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version