I was posting while Megiddo was. I've got more for ya besides what he said.
First tip of Gmod hook and event coding... never return anything (including "true") unless you don't want the hook to be allowed.
Also, some other tips;
I've numbered your lines for example (because I don't know how to get SMF 'code' tag to do it.
01. ULib.ucl.registerAccess("PLX","","Allows users to controll the PlayerX")
02. --- Returns whether a player is permitted to use the player.
03. -- @param ply Player
04. -- @return
05. function PlayX.IsPermitted(ply)
06. if ULib.ucl.query(ply,"PLX",false) then
07. print("Allowed access.")
08.
09. return true
10. else
11. return false
12. end
14. end
The changes below are made on the following tips. (I don't guarantee they will fix your issue, but surely can't hurt.
Line # - Tip
1) ULX turns every command into lower case. Just makes console commands easier to work with. Register "plx" not PLX. (I don't remember if our register command converts)
1) You're feeding the register access a "" group to give default access to. By default, register access grants "no access" if that's done.
5) You're adding on a function to a table. Does PlayX already exist as a table elsewhere in your code?
6) Convert your "PLX" to "plx" to match line 1.
6 to 12) I presume this function is being called from a Gmod prop spawn player hook or similiar. Again, see my first tip of gmod hooks, never return anything unless you don't want it to happen.
Try the following, based on my tips and what information I have regarding your PlayX
I've numbered your lines for example (because I don't know how to get SMF 'code' tag to do it.
ULib.ucl.registerAccess("plx",ULib.ACCESS_SUPERADMIN,"Allows users to controll the PlayerX")
--- Returns whether a player is permitted to use the player.
-- @param ply Player
-- @return
function PlayX.IsPermitted(ply)
if not ULib.ucl.query(ply,"plx",false) then
print("Not Allowed access.")
return false
end
end