cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always.
#1
I was testing out cRankManager:GetPlayerPermissions(UUID), seeing how it returned the *, when I found out it returned... literally nothing. So I tried it out with non-admin groups, and it continued to return nothing. So I tried a different, imperfect method to replicate it. Code and outputs below.

The Code:
function Initialize(a_Plugin)
	a_Plugin:SetName("cRankManagerTest")
	a_Plugin:SetVersion(1)
  
	cPluginManager:BindCommand("/ranky", "a.b", ranksCommand, "")
	
	-- Send a message to the console that Chatter is initialized.
	LOG("Initialized cRankManagerTest v." .. a_Plugin:GetVersion())
	return true
end

function OnDisable()
	LOG("cRankManagerTest is disabled")
end

function ranksCommand(a_split,a_player)
  local UUID = a_player:GetUUID()
  LOG("======================")
  LOG(UUID)
  LOG(a_player:GetName())
  local arr = cRankManager:GetPlayerPermissions(UUID)
  LOG(table.concat(arr,", "))
  local str = ""
  for _,v in pairs(arr) do
    str = str == "" and str .. v or str .. ", " .. v
  end
  LOG(#arr)
  LOG(str)
  LOG("___________________")
  local str2 = ""
  local arr2 = cRankManager:GetPlayerGroups(UUID)
  LOG(#arr2)
  for _,v1 in ipairs(arr2) do
    local arr3 = cRankManager:GetGroupPermissions(v1)
    LOG(#arr3)
    for _,v2 in ipairs(arr3) do

      str2 = str2 == "" and str2 .. v2 or str2 .. ", " .. v2
    end
  end
  LOG(str2)
  LOG("___________________")
  return true
end

No rank assigned:
[15:31:42] ======================
[15:31:42] 3bb504d5e15147dcb104c620315dd5e3
[15:31:42] ZeeTwelveCam
[15:31:42]
[15:31:42] 0
[15:31:42]
[15:31:42] ___________________
[15:31:42] 0
[15:31:42]
[15:31:42] ___________________

Rank assigned:
[15:33:13] ======================
[15:33:13] 3bb504d5e15147dcb104c620315dd5e3
[15:33:13] ZeeTwelveCam
[15:33:13]
[15:33:13] 0
[15:33:13]
[15:33:13] ___________________
[15:33:13] 1
[15:33:13] 1
[15:33:13] *
[15:33:13] ___________________

and for reference:

[15:34:01] ======================
[15:34:01] 3bb504d5e15147dcb104c620315dd5e3
[15:34:01] ZeeTwelveCam
[15:34:01]
[15:34:01] 0
[15:34:01]
[15:34:01] ___________________
[15:34:01] 1
[15:34:01] 2
[15:34:01] core.build, a.b
[15:34:01] ___________________

So did I do something wrong? I currently don't have a way to compile a debug build, so can't provide any information that might give.
Reply
Thanks given by:


Messages In This Thread
cRankManager:GetPlayerPermissions(UUID) returns empty array seemingly always. - by Zee1234 - 12-11-2015, 07:37 AM



Users browsing this thread: 1 Guest(s)