I'm not sure a release thread with 3 replies warrented a new thread for a new version number. Also, I might be picking but at first glance I thought you were posting a new version of UTime. I think your post title may be a little misleading.
Call it what you want, I'm just giving you constructive criticism. I told you what I saw at first glance.
Well, it works for me so I'm okay with it. :p
Hi Guys
I used this on single player, and set myself down to the equivelant of user. I could still use this command though, even though I wasnt a super admin. Do you know why this is?
THanks
-Orrila
Orilla, Utime, and this addon to adjust times in it, has nothing to do with player access.
5 hours, or a 1000, UTime will only show how many.
If you are using another addon that adjusts permission based on time played, it's possible it has its own tracking.
Thank you for your concern. I've looked into this though, and there were no issues that were detected, and that were somewhat similar to your issues. So as far as I know, this addon still remains to not have any issues. I had a few people test it on their server, and it all works fine as dandy. I hope you get your issue fixed.
Any way to view a players time using this if the player is not on the server?
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
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: [Select]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
Negative value will remove hours ;)
Hey Chaos! This addon looks great but when i try to install it it doesnt work,
Methods ive tried to install,
Ive put the whole folder inside my addons folder(didnt think it would work) then
I put the lua inside the lua/ulx/modules/sh.
After i did both ways i try to go and give permission to a rank your name "Apples Creations" Doesnt Not pop up on groups perm.
I also restarted it and nothing happend. i Have ulx.3.61 and ulib 2.51
Any help please!
-Thanks
I used this but everytime I would restart the server it would lose the time that I had set and go back to the original. Anyway to fix that?
Is there a console command, or do I have to actually be on the server to use it?
Did you ever create a mySQL edition?
I'd really be interested in seeing utime for mysql.
Can i have the link to this for my gmod server??(Utime Hour Changer Addon)?
I'm sorry to report that the module for this isn't loading at all. I've checked in the console log and it doesn't report it as loading amongst all the other modules. I've looked several times, and yes, the server has been totally restarted (multiple times). Does it need updating or is it my server? What information can I give you to help figure this out?
Did you put this in addons? Like are you sure you didn't have it like:
gmod/addons/MYADDON/MYADDON/files??
Because I know a lot of people who do that...
Oh I think I figured out the problem. Your folder format inside the download is slightly different from others and you have it nested inside of the root folder in directory called lua, which contains the addon.txt and relevant files. So I should put the LUA folder into the addons folder, not the containing folder (ulx set Utime) . Oops. I thought I was better than this! Sorry to waste your time!
Edit:
This is what I get for jumping on the forums without some morning caffeine. I misread the folder structure in your compressed file download. After re-chcking the FTP folder structure, it's correct. The addon.txt, with it's containing lua folder are in a folder like this: garrysmod/addons/ulx set Utime/addon.txt with a subfolder of 'lua'. It's not working like this for some reason, and i'm not sure why. It's not listed in the ULX loading reports, nor do I have any options for it once I open the GUI.
So apparently it's not starting at all.
Further edit:
I went through and compared the folder structures of both the ULX addon itself, and the change utime folders, and yours looks like it's correct. I'm mystified why it's not loading. What are common reasons for ulx addons not even showing up in the loading status?
Updated All Plugins:
I updated all files/folder names to lowercase and underscores so that we won't have a problem with linux based server.
Special Thanks to Princess Twilight Sparkle
Oh was that the problem? I've been trying to figure out similiar issues with other addons not loading possibly due to similiar problems in a thread here:
http://forums.ulyssesmod.net/index.php/topic,7755.0.html (http://forums.ulyssesmod.net/index.php/topic,7755.0.html)
I believe it IS on a linux based system, but we're moving to a dedicated system hosted by the owner himself now, so we'll have full access and not have to put up with that stupid wrench control panel that doesn't seem to work properly. Thanks for the effort, I really appreciate the assistance.
It was possible that the having a linux based server was the issue with my addon, but it "should" be fixed, according to Princess Brony Person. So, but it's possible that there was maybe another issue with yours, but if it's not loading, I can't really help with that, as it's nothing I can diagnose without it loading and erroring out. But if I recall, GMOD also has it's own loading thing, telling you what loads and what doesn't, though as you said, you don't have access to the main server, it may not be of much help. I suppose all I can say is, good luck mate. If you have any other questions, typically I do not browse these forums anymore, but others are helpful on here, and can provide answers on most problems generally with anything (which includes my plugins).
Bytewave, I've changed the appearance of your name on our forums, at the request of your signature.Right.
I've also deleted your last post.
This thread isn't the place to question such things. I honestly don't think he meant ill-will.
Take it private if you truly wish to question a possible mis-understanding.
Assuming that what I said was most likely taken offensively. Though looking through what I said, I assume that the phrase, 'Princess Brony Person' had offended you. It was not meant to offend you, I had said it more or less as a light joke. Seeing as your signature said something similiar to it, and when I was writing that post, I wrote it on my phone, and I didn't want to check your exact name as the page could crash (iPhone.. 4g), so I decided to just use the name that I really can you remember for. So if what I said offended you, I apologize for that.it's fine... Not sure if it's the best idea to continue taking here, as Jam previously noted...
Chaos,
The adjustments you made to your mod now have it working properly on a linux dedicated when it was not before.
We swapped to a dedicated linux server the owner is hosting directly in his home, and the same modules didn't want to work again. HOWEVER, whatever change(s) you made has yours working.
Can you give me a rundown on what you did so that I can try to replicate it with the other modules?
Edit:
I decided to do the non-lazy thing and review your earlier post. You changed the folder/file names to be lowercase without spaces. This has fixed the other modules!
It might be a good idea to put this in a FAQ somewhere since it's a minor and subtle difference that makes a huge impact on what actually works! A lot of windows users will find this very confusing.
To be honest, I didn't even know that linux ("being as complex as it is"), can't handle a simple uppercase... but oh well.I do believe this is Garry/Facepunch's issue, if not Lua or the Source engine. *nix systems ought to handle capital letters in file/directory names fine.
I do believe this is Garry/Facepunch's issue, if not Lua or the Source engine. *nix systems ought to handle capital letters in file/directory names fine.
Yeah it doesn't make sense to me either. Nor to the other people I'm working with (one of which who's rather expert in linux.)All I can say is... blame Garry.
It's probably one of those stupid differences between the windows and linux versions of gmod that I've had to deal with. One of our admins plays on linux and quite few addons and such have odd or unusual behaviors on linux, according to his experiences.
Chaos,
I have another question for you.
Is it possible to edit the hours of somone who's not on the server but who's in one of the ULX groups? We're going to edit peoples times so the auto promoter demotes them next time they get on (for punishment reasons).
Hey, great module I use it on my server with apromote, people get ranks depending on how long they have played with us. We also give a 4 hour boost to anyone who joins our forums and post an introduction to get more people on there. So I created a module called addtime which I copied a lot of what you had and modified it to, addtime adds the hours specified on top of what they had. This way I can add say 4 hours and they don't lose the 40 min they had into that hour. I hope this is okay and if your interested I can give it to you.
---------------------------------add time--------------------------------------
function ulx.addtime( calling_ply, target_ply, time )
local affected_plys = {}
function updatePlayer( ply )
sql.Query( "UPDATE utime SET totaltime = " .. math.floor( ply:GetUTimeTotalTime() ) .. " WHERE player = " .. ply:UniqueID() .. ";" )
end
function updateAll()
local players = player.GetAll()
for _, ply in ipairs( players ) do
if ply and ply:IsConnected() then
updatePlayer( ply )
end
end
end
local plyID = tostring(target_ply:UniqueID())
local ply = player.GetByUniqueID(plyID)
local ammount = tonumber(tostring(time))
ammount = ammount * 3600
newtime = ply:GetUTimeTotalTime() + ammount
ply:SetUTime( newtime )
ply:SetUTimeStart( CurTime() )
//sql.Query( "UPDATE utime SET totaltime = " .. math.floor(newtime) .. " WHERE player = " .. plyID .. ";" )
updateAll()
table.insert( affected_plys, target_ply )
ulx.fancyLogAdmin( calling_ply, "#A added #s hours to #T", time, affected_plys )
end
local addtime = ulx.command( CATEGORY_NAME, "ulx addtime", ulx.addtime, "!addtime" )
addtime:addParam{ type=ULib.cmds.PlayerArg }
addtime:addParam{ type=ULib.cmds.NumArg, min=0, default=1, hint="Hours" }
addtime:defaultAccess( ULib.ACCESS_SUPERADMIN )
addtime:help( "Add hours to a players time - !addtime" )
Why doesn't this work for me? Someone please help me. I want this because the Utime somehow stuffed up and reset the time:|
Make sure you're getting UTime, ULib and ULX from the Ulysses Github repository site.
It's part of our entire project zip. You don't need all of the foders in that zip, but definitely need the latest UTime.
Are you talking to me? If so I get ulx/ulib from the Ulysses site or github authored by the team. And Utime I grabbed from this thread straight from the github as well. As I mentioned, I've only seen this once, and since then I haven't seen it at all. So I'm not sure why it wouldn't show up once and never again.. Weird.
This doesn't have utime packed in it, you need to get utime yourself.
Yes I have utime from the original thread. I thought I was in that thread for a second. Should I just go over there then?
EDIT: to be clear, I've downloaded the github version already (last updated 2 years ago) which is how I got the addon in the first place.
Where can I find utime sql?
HOW DO I PUT THIS IN MY SERVERhttps://www.google.com/search?q=how+to+install+gmod+addon (https://www.google.com/search?q=how+to+install+gmod+addon)
why cant i access the download i really want this :(
Please Keep Note:
<clip>
You must be registered and logged in the ulx forum to see the download link which is found under the preview image
<clip>
Whole bunch of other cool stuff explaining the addon
<clip>
BIG giant example picture.
<clip>You must be registered and logged in the ulx forum to see the download link which is found under the preview image
You're joking, right?
Read the first post. All the way through.
It tells you TWICE the likely reason.
Here, I'll even summarize quote it for you.
Im Logged In But There Is No Download Link WTF....
These are some great addons.
By chance do you have them checked into github, gitlabs or biitbucket? That is how I watch for changes on most things.
Regards
P.S. I tried to PM you instead of posting here, but PM's appear to be blocked. Perhaps because I recently registered.