• Making uTime admin only
    8 replies, posted
All i want to do is make uTime visible by admin only. Im not exactly sure which lua file i would edit to do that, or what exactly to type. I dont think it would be too complicated, so if you guys could help me that would be AWESOME. Thanks! uTime: [URL="https://github.com/Nayruden/Ulysses/tree/master/utime"]https://github.com/Nayruden/Ulysses/tree/master/utime[/URL]
Ok, so it's kinda working... I changed UniqueID To IsAdmin on the 2nd link, and IsConnected to IsAdmin on the third link, but i wasn't sure what to change on the first one. Results: Now users can see their own time (That's fine to me) and i can see everyone's like it was meant to be, but moderators and admins cant see anyone's, not even their self's. I don't mind keep seeing your own time, im not sure what did that, but that's fine. At minimum, i would like the fix staff seeing their own/others time. Thanks
He meant add a check, not replace an existing check.
well, im not familiar with the terms when coding, could anyone please tell me what a check is .-.
if (conditions) then //do stuff
so, I'm still slightly confused, and i greatly appreciate the help im getting, in this case would it be: "if IsAdmin then //" that is me guessing... Would i put that under the function onJoin ( ply )
Example (Line 42):[CODE] if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or [/CODE] Adding the "Check" to see if they are admin means to just add "IsAdmin()" to he if/then line. So with the check it would look like: [CODE]if not utime_enable:GetBool() or not IsValid( LocalPlayer() ) or not ply:IsAdmin() or[/CODE] For whatever reason it had an "or" at the end so i stuck it back on. So basically copy what i did to the 3 lines Handsome Matt posted. If that doesnt work change ply: to LocalPlayer():
[lua]if ( not utime_enable:GetBool() or not LocalPlayer():IsValid() or not LocalPlayer():IsAdmin or not LocalPlayer():IsSuperAdmin() ) then[/lua]
Sorry, you need to Log In to post a reply to this thread.