Help me Lua


for _,v in pairs(ents.GetAll()) do
		if IsValid(v) then
			if v:IsPlayer() then
				strMapIcon = "gui/player" -- I dont have any alternative
			end
			if v:IsSuperAdmin() then
				strMapIcon = "gui/admin" -- I dont have any alternative
			end


[ERROR] gamemodes/underdone/gamemode/core/clientfiles/cl_hud_minimap.lua:31: attempt to call method 'IsSuperAdmin' (a nil value)
  1. v - gamemodes/underdone/gamemode/core/clientfiles/cl_hud_minimap.lua:31
   2. unknown - lua/includes/modules/hook.lua:84


Try something like



if IsValid(v) then
    if v:IsPlayer() then
        if v:IsSuperAdmin() then
            strMapIcon = "gui/admin"
        else
            strMapIcon = "gui/player"
        end    
    end
end

Work tys.