Skip to main content

FetchRoles

Server
Lyn.Player.FetchRoles(string steamid64, function callback)Function

Description

Fetches the roles of the player using their SteamID64.

Params

  1. string steamid64
  2. function callback

    Callback function when operation completes/fails.

    Callback params(s):

    1. table | nil err

      Error if failed.

    2. table | nil roles

      Array of roles assigned to the player.

Example:

Lyn.Player.FetchRoles("76561198261855442", function(err, roles)
if err then
-- database error already printed in console by Lyn
print("Error fetching roles")
return
end

PrintTable(roles)

-- Output:
--[[
{
{
-- Permanent role
expires_at = 0,
role = "user"
},
{
-- Temporary role
expires_at = 1858380144,
role = "admin"
}
}
]]
end)