BAE - Help with addition admin level, and permissions

Hello developers! I am trying to edit basic admin essentials to add custom rank and additional ranks for my cafe game. As of current I have added the additional ranks but it appears that the permissions are not correctly working.

I am trying to make it to where certain commands are locked for certain admin ranks and above, I tried editing the permissions table, but it then shutdown the entire code.

The issue is that whenever I attempt to lock commands, or make the admins appear while using the “ingameadmins” command there is no ranklock, or response from the commands.

Some example are:
My Senior Administrator level is 4, they receive access to btools, while I have specified it to be locked to Development Team which is level 6.

I have followed several other Devforum posts, and I have edited the code but again it stops the admin from working in game.

What is the best way to fix this, or what should I do to fix this issue?

I have attached a model for your convenience. This contains all my code.

Any additional help would be greatly appreciated.

Edit: Posting this on mobile so sorry if it comes across unclear.

1 Like

Alright, I think I see the problem here. After looking through the main module code, the module has the max permission set to 4, meaning that anything above 4 would be set to 4. I’m assuming all I would need to do here is change that number to a 7 to fix the problem, but I will come back after trying and tell you the results.
image

Alright, it seems this was the problem. I went onto a local test server with Player1’s permission set to a Senior Admin (it auto-sets the owner’s permission to a 7 might just be me idk) and it could no longer access the btools command. The problem was on line 3192.

1 Like

I believe that fixes issue 1. I do need to figure out when you run “ingameadmins” no users show up. Is this something on my end or are you experiencing this as well?

Yes, it shows the panel for me but says “No Data.”

What is a solution to fixing that. I’ve looked at the permission return and edited that but it still shuts down the entire module.

Well, it’s not a permission problem here; looking at the function, it seems to be another problem with the permission amount. (zoomed in so you could see)
image

1 Like

I’ve attempted to change that. There are 2 or 3 of those tables I believe and when I do there is no response from the admin panel on game test. It may be the fact that I didn’t set the max permission level before but I am unsure.

changed the code to

for a,b in next,playerService:GetPlayers() do
	local Perm = returnPermission(b)
	if Perm > 0 then
		if Perm == 1 then
			table.insert(Table,'[Mod]: '..b.Name)
		elseif Perm == 2 then
			table.insert(Table,'[Senior Mod]: '..b.Name)
		elseif Perm == 3 then
			table.insert(Table,'[Admin]: '..b.Name)
		elseif Perm == 4 then
			table.insert(Table,'[Senior Admin]: '..b.Name)
		elseif Perm == 5 then
			table.insert(Table,'[Executive Admin]: '..b.Name)
		elseif Perm == 6 then
			table.insert(Table,'[Developer]: '..b.Name)
		elseif Perm >= 7 then
			table.insert(Table,'[Game Owner]: '..b.Name)
		end
	end
end

and it works just fine now.
image

1 Like

What line is that in which script?

Starting line is 632 for that piece, and as for the piece of the other code that I had provided, it would now be line 3194.

As long as it works it looks good.

Thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.