IsSuperAdmin Error!

Recently it hasn’t been registering super admins.



ERROR: GAMEMODE:'OnPlayerChat' Failed: JailBreak/gamemode/cl_init.lua:25: attempt to call method 'IsSuperAdmin' (a nil value)


[lua]
function GM:OnPlayerChat( pl, msg )
local args = {} – table.
if pl:Leader( ) == 1 then
table.insert( args, Color( 255, 105, 180, 255 ) ) – hot pink
table.insert( args, "(Epic) " )
table.insert( args, Color( 255, 255, 255, 255 ) )
table.insert( args, pl )
table.insert( args, ": " )
table.insert( args, msg )
elseif pl:Donator( ) == 1 then
table.insert( args, Color( 255, 020, 147, 255 ) ) – deep pink
table.insert( args, "(VIP) " )
table.insert( args, Color( 255, 255, 255, 255 ) )
table.insert( args, pl )
table.insert( args, ": " )
table.insert( args, msg )
elseif pl:IsSuperAdmin() then
table.insert( args, Color( 255, 000, 000, 255 ) ) – red
table.insert( args, "(SuperAdmin) " )
table.insert( args, Color( 255, 255, 255, 255 ) )
table.insert( args, pl )
table.insert( args, ": " )
table.insert( args, msg )
elseif pl:IsAdmin() then
table.insert( args, Color( 255, 165, 000, 255 ) ) – orange
table.insert( args, "(Admin) " )
table.insert( args, Color( 255, 255, 255, 255 ) )
table.insert( args, pl )
table.insert( args, ": " )
table.insert( args, msg )
else
table.insert( args, Color( 190, 190, 3190, 255 ) ) – grey for teh fag
table.insert( args, "(Guest) " )
table.insert( args, Color( 255, 255, 255, 255 ) )
table.insert( args, pl )
table.insert( args, ": " )
table.insert( args, msg )
end
table.insert( args, Color( 125, 125, 125, 255 ) )
chat.AddText( unpack(args) ) – unpacking the table state on first line of function, add chat tag along with chat text.
return true
end
[/lua]

First of all, you need to call pl:IsAdmin() before you call pl:IsSuperAdmin(), because super admins are always admins, but admins dont always have to be superadmins, get it? :stuck_out_tongue:

Though I dont know what is causing the problem.

No, you need to call IsAdmin after IsSuperAdmin, otherwise all superadmins would only be shown as Admins.

As for your problem, did you modify the IsSuperAdmin function when you added those other functions to the player metatable?

Oh right, missed that, sorry for that.