Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: iitiago on September 27, 2019, 05:12:02 PM
-
I'm learning lua so I'm studying gmod lua addons and found this piece of code. What does this do exactly? and what does it return?
local function hasAccess(ply)
if ulx then
return ply:query("ulx seeasay")
end
-
ply:query is checking ULib to see if the player (represented by ply here) has the "ulx seeasay" permission flag.
The rest of the code is just wrapping our permission check function inside of another function, presumably so they can support multiple admin mods if needed.
-
ply:query is checking ULib to see if the player (represented by ply here) has the "ulx seeasay" permission flag.
The rest of the code is just wrapping our permission check function inside of another function, presumably so they can support multiple admin mods if needed.
Thank you so much!
-
litiago, and if it's not obvious, 'query' is not a standard Lua, or Gmod lua function.
It's part of our Ulysses Library (ULib)
Documented here - https://ulyssesmod.net/docs/files/lua/ulib/shared/sh_ucl-lua.html#ucl.query